Code Monkey home page Code Monkey logo

Comments (3)

shnax avatar shnax commented on September 22, 2024 3

Thanks! I was having the same issue and that got it working. Just had to change my systemd service to:

[Unit]
Description=Dasher
After=network.target

[Service]
Type=simple
User=root
WorkingDirectory=/home/pi/dasher
ExecStart=/usr/bin/npm start
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

from dasher.

hoveeman avatar hoveeman commented on September 22, 2024

I created a systemd service for dasher and it is working well on boot. Here is my file if anyone is interested:

/etc/systemd/system/dasher.service

[Unit]
Description=Dasher
After=network.target

[Service]
Type=simple
User=root
ExecStart=/usr/local/bin/node /home/pi/dasher/app.js
Restart=on-failure
RestartSec=10

[Install]
WantedBy=multi-user.target

Once you create that file, you will need to reload, enable, and start it.

sudo systemctl daemon-reload
sudo systemctl enable dasher
sudo systemctl start dasher

You can check on the status of the service by typing this command.
sudo systemctl status dasher -l

from dasher.

Aeefire avatar Aeefire commented on September 22, 2024

For me both methods on a rpi jessie seem to fail.

Anyone has a solution?

pi@raspberrypi:/var/log $ tail syslog
Jan 29 11:24:11 raspberrypi npm[1285]: npm ERR! code ELIFECYCLE
Jan 29 11:24:11 raspberrypi npm[1285]: npm WARN This failure might be due to the use of legacy binary "node"
Jan 29 11:24:11 raspberrypi npm[1285]: npm WARN For further explanations, please read
Jan 29 11:24:11 raspberrypi npm[1285]: /usr/share/doc/nodejs/README.Debian
Jan 29 11:24:11 raspberrypi npm[1285]: npm ERR!
Jan 29 11:24:11 raspberrypi npm[1285]: npm ERR! Additional logging details can be found in:
Jan 29 11:24:11 raspberrypi npm[1285]: npm ERR! /home/pi/dasher/npm-debug.log
Jan 29 11:24:11 raspberrypi npm[1285]: npm ERR! not ok code 0
Jan 29 11:24:11 raspberrypi systemd[1]: dasher.service: main process exited, code=exited, status=1/FAILURE
Jan 29 11:24:11 raspberrypi systemd[1]: Unit dasher.service entered failed state.
pi@raspberrypi:/var/log $ tail /home/pi/dasher/npm-debug.log
10 error You can get their info via:
10 error npm owner ls dasher
10 error There is likely additional logging output above.
11 error System Linux 4.4.38-v7+
12 error command "/usr/bin/nodejs" "/usr/bin/npm" "start"
13 error cwd /home/pi/dasher
14 error node -v v0.10.29
15 error npm -v 1.4.21
16 error code ELIFECYCLE
17 verbose exit [ 1, true ]

after removing the init.d entry

sudo systemctl status dasher -l
● dasher.service - Dasher
Loaded: loaded (/etc/systemd/system/dasher.service; enabled)
Active: activating (auto-restart) (Result: exit-code) since Sun 2017-01-29 11:41:25 UTC; 2s ago
Process: 1195 ExecStart=/usr/bin/npm run start (code=exited, status=1/FAILURE)
Main PID: 1195 (code=exited, status=1/FAILURE)

Jan 29 11:41:25 raspberrypi systemd[1]: Unit dasher.service entered failed state

from dasher.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.