running raspberry-instock-check as a service
Closed this issue · 2 comments
careyer commented
Hi there,
I try to run your raspberry-instock-check as a service on my system but sadly I am not successful in doing so. It seems like when running as a service it cannot write its output to tty. Have you ever tried to run it as a service and could share how you managed to do so?
Thank you!
Keep up the excellent work!
rigwild commented
I use PM2.
it cannot write its output to tty
That's weird, it only uses normal console.log
, so shouldn't cause any issues?
careyer commented
Got it working.... the trick was to specify the working directory in the system unit file:
[Unit]
Description=rpicheck
After=network-online.target
[Service]
WorkingDirectory=/home/pi/raspberry-instock-check
ExecStart=/home/pi/raspberry-instock-check/rpicheck.sh
User=pi
[Install]
WantedBy=multi-user.target
Ticket can be closed, thanks!