klabo on Nostr: ChatGPT is so cool: how do i set up multiple services that start up in a tmux session ...
ChatGPT is so cool:
how do i set up multiple services that start up in a tmux session from systemd on ubuntu
1. Create a systemd service unit file for each service that you want to start up in a tmux session.
2. Add the following to each service unit file:
[Service]
ExecStart=/usr/bin/tmux new-session -d -s <session_name> <command>
Replace <session_name> with the name of the tmux session and <command> with the command to start the service.
3. Start the services with the following command:
sudo systemctl start <service_name>
Replace <service_name> with the name of the service.
4. Enable the services to start automatically on boot with the following command:
sudo systemctl enable <service_name>
Replace <service_name> with the name of the service.
Published at
2023-03-08 20:00:21Event JSON
{
"id": "1394fe8f9c6299952d22f8c08c596cae3f96e6e9a42ffbf0840b11df5e3249c2",
"pubkey": "2f4fa408d85b962d1fe717daae148a4c98424ab2e10c7dd11927e101ed3257b2",
"created_at": 1678305621,
"kind": 1,
"tags": [],
"content": "ChatGPT is so cool:\n\nhow do i set up multiple services that start up in a tmux session from systemd on ubuntu\n\n1. Create a systemd service unit file for each service that you want to start up in a tmux session.\n\n2. Add the following to each service unit file:\n\n[Service]\nExecStart=/usr/bin/tmux new-session -d -s \u003csession_name\u003e \u003ccommand\u003e\n\nReplace \u003csession_name\u003e with the name of the tmux session and \u003ccommand\u003e with the command to start the service.\n\n3. Start the services with the following command:\n\nsudo systemctl start \u003cservice_name\u003e\n\nReplace \u003cservice_name\u003e with the name of the service.\n\n4. Enable the services to start automatically on boot with the following command:\n\nsudo systemctl enable \u003cservice_name\u003e\n\nReplace \u003cservice_name\u003e with the name of the service.",
"sig": "090c17a1a9214445624b5b35b13a136a2f3deaa63561effa0bb6028f283e73bec4dc349f47324ad3c9d2c624ec49a664cfd764cb2ba626097ae943e65f7bdaab"
}