Skip to content

Instantly share code, notes, and snippets.

@Kirill
Created June 19, 2019 14:14
Show Gist options
  • Save Kirill/e32c2d9392bccb84949acd947dc1d20f to your computer and use it in GitHub Desktop.
Save Kirill/e32c2d9392bccb84949acd947dc1d20f to your computer and use it in GitHub Desktop.
Simple service for Linux: /etc/systemd/system/simple.service
[Unit]
Description=Simple Service Description
After=syslog.target
After=network.target
[Service]
Type=simple
WorkingDirectory=/usr/local/bin
User=root
Group=root
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/simple
ExecStartPre=/bin/chmod 640 /var/log/simple
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=simple
OOMScoreAdjust=-100
ExecStart=/usr/local/bin/simpleapp
ExecStop=/bin/kill -s QUIT $MAINPID
TimeoutSec=300
Restart=always
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment