Skip to content

Start on Bootup

Alexis Leon edited this page Jul 23, 2017 · 2 revisions

Go to project folder and make homepi script globally available:

npm link

Create service file:

sudo nano /etc/systemd/system/homepi.service

Paste the code:

[Unit]
Description=HomePi Service
After=syslog.target network-online.target

[Service]
Type=simple
User=homepi
ExecStart=/usr/local/bin/homepi
Restart=on-failure
RestartSec=10
KillMode=process

[Install]
WantedBy=multi-user.target

Reload services:

sudo systemctl daemon-reload

Enable and start the service

sudo systemctl enable homepi
sudo systemctl start homepi
systemctl status homepi

Reboot.

Clone this wiki locally