-
-
Save sergeyklay/b364e4a7e4f4311c3b47ae55ee770530 to your computer and use it in GitHub Desktop.
Sample service unit file for systemd
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
[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