Skip to content

Instantly share code, notes, and snippets.

@tonymtz
Created August 23, 2018 07:37
Show Gist options
  • Save tonymtz/cf0b29b472597c96cac5f949e9452631 to your computer and use it in GitHub Desktop.
Save tonymtz/cf0b29b472597c96cac5f949e9452631 to your computer and use it in GitHub Desktop.
[Unit]
Description=Gatomocho service
ConditionPathExists=/home/ubuntu/work/src/gatomocho/main
After=network.target
[Service]
Type=simple
User=gatomocho
Group=gatomocho
LimitNOFILE=1024
Restart=on-failure
RestartSec=10
startLimitIntervalSec=60
WorkingDirectory=/home/ubuntu/work/src/gatomocho
ExecStart=/home/ubuntu/work/src/gatomocho/main
# make sure log directory exists and owned by syslog
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/gatomocho
ExecStartPre=/bin/chown syslog:adm /var/log/gatomocho
ExecStartPre=/bin/chmod 755 /var/log/gatomocho
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=gatomocho
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment