Commit cc564deb authored by Karl Fleischmann's avatar Karl Fleischmann

Add daemon-module

* Outsource forking-routines to own module
parent decb8120
# -*- coding: utf-8 -*-
import os
import sys
class Daemon(object):
"""Daemon class for usage in background."""
def __init__(self, args):
self.args = args
def start(self):
"""Start daemonizing this program."""
print("hack_count started in daemon-mode (printing disabled)...")
self.args.printing = False
pid = os.fork()
if pid > 0:
# exit first parent
except OSError:
sys.stderr.write("fork failed")
\ No newline at end of file
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