Last active
March 22, 2022 14:15
-
-
Save mmalmi/699939ca0ce223431c59914fff8231cd to your computer and use it in GitHub Desktop.
Gun.js systemd service
This file contains 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=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