Skip to content

Instantly share code, notes, and snippets.

@moaoa
Last active November 9, 2024 17:25
Show Gist options
  • Save moaoa/f6b5b03601ff72aee492e485bca152b0 to your computer and use it in GitHub Desktop.
Save moaoa/f6b5b03601ff72aee492e485bca152b0 to your computer and use it in GitHub Desktop.
// vi /etc/systemd/system/foo.service
[Unit]
Description=Run a command at startup
[Service]
ExecStart=/path/to/your/command
[Install]
WantedBy=multi-user.target
// sudo systemctl enable foo.service
// sudo systemctl start foo.service
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment