Skip to content

Instantly share code, notes, and snippets.

@smartass08
Last active June 11, 2022 20:24
Show Gist options
  • Save smartass08/7b9b0da510e4c603e6f849f3367b3cea to your computer and use it in GitHub Desktop.
Save smartass08/7b9b0da510e4c603e6f849f3367b3cea to your computer and use it in GitHub Desktop.
[Unit]
Description=Your service description
[Service]
Restart=always
WorkingDirectory=/home/user/to/path
ExecStartPre=/usr/bin/whatever/app command to execute before actual command
ExecStart=/usr/bin/whatever/app main command
[Install]
WantedBy=default.target
@smartass08
Copy link
Author

copy this to ~/.config/systemd/user/ yes user is actual word "user" (Don't get confused it by your username)

systemctl --user [start || status || stop] example.service

@smartass08
Copy link
Author

sudo loginctl enable-linger $USER

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment