Calling script from daemon
I am trying to call a script from python-daemon but it doesn't work. this is what I am linking, is it correct?
I also want to pass a random argument to this script, currently I have hardcoded it
import daemon import time import subprocess import os def interval_monitoring(): print "Inside interval monitoring" while True: print "its working" # os.system("XYZ.py 5416ce0eac3d94693cf7dbd8") Tried this too but not working subprocess.Popen("XYZ.py 5416ce0eac3d94693cf7dbd8", shell=False) time.sleep(60) print "condition true" def run(): print daemon.__file__ with daemon.DaemonContext(): interval_monitoring() if __name__ == "__main__": run()
source to share