Last active
November 30, 2021 17:41
-
-
Save dacr/14b2b754ce41e57b0a0d44b5917e1cc4 to your computer and use it in GitHub Desktop.
Simple way to create a systemd service with a blocking command / published by https://github.com/dacr/code-examples-manager #ced76171-53bc-4d99-bc22-9b36a3bc0657/e5002527399dcc0de774841e89e6c61aeb4d6065
This file contains hidden or 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
## summary : Simple way to create a systemd service with a blocking command | |
## keywords : systemd, simple, service | |
## publish : gist | |
## authors : David Crosson | |
## license : none | |
## id : ced76171-53bc-4d99-bc22-9b36a3bc0657 | |
## created-on : 2020-07-18T13:24:58Z | |
## managed-by : https://github.com/dacr/code-examples-manager | |
# - Place the file into `/etc/systemd/system/` directory | |
# - Requires this instruction for any changes to be take into account by systemd | |
# - `systemctl daemon-reload` | |
# - `systemctl enable SomeService` | |
# - `systemctl start SomeService` | |
[Unit] | |
Description=SomeService | |
After=syslog.target network.target remote-fs.target nss-lookup.target | |
[Service] | |
Type=simple | |
WorkingDirectory=/somewhere | |
ExecStart=/somewhere/bin/someBlockingCommand | |
Environment=VAR1=VAL1 | |
Environment=VAR2=VAL2 | |
Restart=on-failure | |
LimitNOFILE=10000 | |
User=auser | |
Group=users | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment