Skip to content

Instantly share code, notes, and snippets.

@mmalmi
Last active March 22, 2022 14:15
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 mmalmi/699939ca0ce223431c59914fff8231cd to your computer and use it in GitHub Desktop.
Save mmalmi/699939ca0ce223431c59914fff8231cd to your computer and use it in GitHub Desktop.
Gun.js systemd service
[Unit]
Description=Gun.js server
ConditionPathExists=/home/user/src/gun
After=network.target
[Service]
Type=simple
User=www-data
Group=www-data
LimitNOFILE=50000
LimitCORE=infinity
Restart=on-failure
RestartSec=1
WorkingDirectory=/home/user/src/gun
ExecStart=/home/user/.nvm/versions/node/v17.7.1/bin/node examples/http.js
# make sure log directory exists and owned by syslog
PermissionsStartOnly=true
ExecStartPre=/bin/mkdir -p /var/log/gunjs
ExecStartPre=/bin/chown syslog:adm /var/log/gunjs
ExecStartPre=/bin/chmod 755 /var/log/gunjs
StandardOutput=syslog
StandardError=syslog
SyslogIdentifier=gunjs
[Install]
WantedBy=multi-user.target
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment