Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Please update README with instructions to control njspc with systemd #191

Closed
dkossman opened this issue Jul 22, 2020 · 1 comment
Closed

Comments

@dkossman
Copy link

dkossman commented Jul 22, 2020

This systemd setup worked for me on Raspbian - can you add to the README? Seems like it might be helpful for others. This is based on a gitter post by @guru-florida, slightly adjusted for my configuration.

pi> sudu vi /etc/systemd/system/poolController.service # or your favorite editor

this file should contain the following. You may need to edit to adjust the user, working directory, or start command for your installation and OS:

[Unit]
Description=NodeJS Pool Controller
Documentation=https://github.com/tagyoureit/nodejs-poolController/
After=network.target

[Service]
Environment=NODE_ENV=production
Type=simple
User=pi
WorkingDirectory=/home/pi/nodejs-poolController
ExecStart=/usr/local/bin/node dist/app.js
Restart=on-failure
RestartSec=15s

[Install]
WantedBy=multi-user.target

Then run these commands:

pi> sudo systemctl daemon-reload
pi> sudo systemctl enable poolController
pi> sudo systemctl start poolController

To check the status of the service:
pi> systemctl status poolController

To tail the log:
pi> sudo -n journalctl -o cat -n 2500 -f -u poolController # tail the poolController log, -u option is based on service name

To stop, restart or disable the service, use the appropriate systemctl command:

pi> sudo systemctl stop poolController
pi> sudo systemctl restart poolController
pi> sudo systemctl disable poolController
@tagyoureit
Copy link
Owner

Added this to the wiki and added to Readme! Thanks very much.

tagyoureit added a commit that referenced this issue Jul 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants