0

I'm working on an emailnotifier script on RaspberryPi which was written in Python. I've found a tutorial page, I've exactly copied the default code (which works fine with a simple "python emailnotifier.py") but I wanted to improve it as a startup service.

The code can be found at the bottom at this page (Sorry dunno how to insert it):

https://pimylifeup.com/raspberry-pi-email-notifier/

After I start the service then check the status, the following can be read:

"Stopping system #DAEMON_NAME daemon:start-stop-daemon: warning: failed to kill 2270: No such process

No process in pidfile '/var/run/emailnotifier.pid' found running; none killed.

failed!

1 Answer 1

0

Looks like you need to add writing pidfile to your code.

at the begining

import os

and before first try:

open('/var/run/emailnotifier.pid','w').write(str(os.getpid()))

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .