Does anyone know of a working and well documented implementation of a daemon using python? Please post a link here if you know of a project that fits these two requirements.
Does anyone know of a working and well documented implementation of a daemon using
Share
Three options I can think of-
multiprocessingmodule. The nitty-gritty of trying to fork a process etc. are hidden in this implementation. It’s pretty neat.I wouldn’t recommend 2 or 3 ‘coz you’re in fact repeating cron functionality. The Linux system paradigm is to let multiple simple tools interact and solve your problems. Unless there are additional reasons why you should make a daemon (in addition to trigger periodically), choose the other approach.
Also, if you use daemonize with a loop and a crash happens, make sure that you have logs which will help you debug. Also devise a way so that the script starts again. While if the script is added as a cron job, it will trigger again in the time gap you kept.