# create systemd service
vim /lib/systemd/system/simple-api.service
...
# install systemd service unit and enable it so it will be executed at the boot time
systemctl enable simple-api.service
# start
systemctl start simple-api.service
Last active
February 8, 2019 05:27
-
-
Save channprj/e68fbfd8803155080401e1195b38871c to your computer and use it in GitHub Desktop.
Very simple and naive systemd daemon for simple api.
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
[Unit] | |
Description=Simple API Service | |
[Service] | |
Type=simple | |
ExecStart=/opt/simple/simple-api | |
ExecStop=kill $(pgrep -f simple-api) | |
Restart=on-failure | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment