nklerk / neeo_driver-kodi

NEEO Kodi driver
6 stars 3 forks source link

System Service #12

Open kalle2000 opened 5 years ago

kalle2000 commented 5 years ago

Cant manage to add this as a system service:

`[Unit] Description=Neeo Kodi After=network.target

[Service]

ExecStart=/usr/local/bin/node --debug /home/pi/neeo_driver-kodi/devices/index.js

ExecStart=npm start /home/pi/neeo_driver-kodi/ Restart=always RestartSec=60 TimeoutSec=300 StandardOutput=syslog StandardError=syslog SyslogIdentifier=xiaomi User=pi

[Install] WantedBy=multi-user.target ` Output from the log: Aug 23 21:53:50 systemd[1]: Started neeo-kodi. Aug 23 21:53:55 node[10800]: Kodi Driver by Niels de Klerk. Aug 23 21:53:55 systemd[1]: neeo-kodi.service holdoff time over, scheduling restart. Aug 23 21:53:55 systemd[1]: Stopping neeo-kodi... Aug 23 21:53:55 systemd[1]: Starting neeo-kodi... Aug 23 21:53:55 systemd[1]: Started neeo-kodi. Aug 23 21:53:58 systemd[1]: Stopping neeo-kodi... Aug 23 21:53:58 systemd[1]: Stopped neeo-kodi.

PascalBu commented 5 years ago

Try running the debug driver using pm2, this will daemonize the .js for you

nklerk commented 5 years ago

Thanks for helping out. I honestly don’t remember how I got the code to start at boot. Im far from a Linux wizard myself.