Skip to content

Instantly share code, notes, and snippets.

@alpap
Created October 31, 2018 14:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alpap/0774f37e8d185cc03349f694201edaf7 to your computer and use it in GitHub Desktop.
Save alpap/0774f37e8d185cc03349f694201edaf7 to your computer and use it in GitHub Desktop.
servicemd
cat <<'EOF' > /etc/systemd/system/beepkg.service
[Unit]
Description=beepkg
AssertPathExists=/usr/local/beepkg
[Service]
WorkingDirectory=/usr/local/beepkg
ExecStart=/usr/local/beepkg/beepkg
ExecReload=/bin/kill -HUP $MAINPID
LimitNOFILE=65536
Restart=always
RestartSec=5
[Install]
WantedBy=multi-user.target
EOF
Install service
chmod +x beepkg
chmod 644 /etc/systemd/system/beepkg.service
systemctl daemon-reload
systemctl enable beepkg
systemctl start beepkg
systemctl status beepkg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment