diff options
-rw-r--r-- | monitor_unified.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/monitor_unified.py b/monitor_unified.py index f00c710..5279022 100644 --- a/monitor_unified.py +++ b/monitor_unified.py @@ -494,13 +494,13 @@ class Rain(Sensor): def clean_exit(sig,frame): #do some other cleanup if you want - os.remove('/var/run/user/[your uid]/RPGH_starter.pid') + os.remove('/var/run/user/1000RPGH_starter.pid') os.exit(0) def start(): signal.signal(signal.SIGTERM, clean_exit)#from start-stop-daemon signal.signal(signal.SIGINT, clean_exit)#from ctrl-c - with open('/var/run/user/[your uid]/RPGH_starter.pid', 'x') as pid_file: + with open('/var/run/user/1000/RPGH_starter.pid', 'x') as pid_file: pid_file.write(str(os.getpid())) do_main_loop() @@ -513,7 +513,7 @@ def main(): if os.fork():sys.exit(0) start() elif action=='stop': - with open('/var/run/user/[your uid]/RPGH_starter.pid', r') as pid_file: + with open('/var/run/user/1000/RPGH_starter.pid', r') as pid_file: pid=int(pid_file.read()) os.kill(pid,signal.SIGTERM) @@ -526,7 +526,7 @@ def main(): child.wait(timeout=10) except psutil.TimeoutExpired:#we didn't exit/clean up in time child.kill() - os.remove('/var/run/user/[your uid]/RPGH_starter.pid') + os.remove('/var/run/user/1000/RPGH_starter.pid') if __name__ == '__main__': fq = cfg.getint('hardware_settings', 'read_frequency') |