Created
May 4, 2018 14:09
-
-
Save chrj/47a1e66bad15a25d7aa3e89fbc507c9b to your computer and use it in GitHub Desktop.
Sample service unit file for systemd
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=My service | |
[Service] | |
ExecStart=/usr/local/bin/my-service \ | |
-argument value \ | |
-otherargument othervalue | |
# Setuid/Setgid | |
User=nobody | |
Group=nogroup | |
# Create a private tmp and device dir for this process | |
PrivateTmp=true | |
PrivateDevices=true | |
# Mount system and home directories read-only | |
ProtectSystem=full | |
ProtectHome=read-only | |
# if privileged ports are needed | |
# CapabilityBoundingSet=CAP_NET_BIND_SERVICE | |
# Any need environment variables | |
# Environment='KEY=value' | |
[Install] | |
WantedBy=multi-user.target |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment