Commit c17c7f78 authored by Markus's avatar Markus

added fork for deamonization

parent 489f2565
......@@ -33,7 +33,6 @@ app_name = ('Hack-Space User Count')
if __name__ == '__main__':
###parser
parser = argparse.ArgumentParser(description='Access Peoplecounter in\
Hackspace and create notification or print ')
......@@ -49,6 +48,16 @@ if __name__ == '__main__':
update default=30",default=30)
args = parser.parse_args()
try:
pid = os.fork()
if pid > 0:
# exit first parent
sys.exit(0)
except OSError:
sys.stderr.write("fork failed")
sys.exit(1)
while True :
##fetch usercount
var = urllib.request.urlopen("http://hack-hro.de/api/users")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment