Last active
October 22, 2024 03:46
-
-
Save machiel/9e8ae2cc300a8f29f7a2df23f142a902 to your computer and use it in GitHub Desktop.
systemctl golang service
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/lib/systemd/system/myservice.service | |
[Unit] | |
Description=Service | |
ConditionPathExists=/path/to/web/folder | |
[Service] | |
User=myuser # make sure to do run $ loginctl enable-linger myuser | |
Group=mygroup | |
Restart=always | |
RestartSec=3 | |
WorkingDirectory=/path/to/web/folder | |
ExecStart=/path/to/web/folder/executable | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment