diff options
author | Anthony G. Basile <blueness@gentoo.org> | 2015-07-02 18:32:51 -0400 |
---|---|---|
committer | Anthony G. Basile <blueness@gentoo.org> | 2015-07-02 18:32:51 -0400 |
commit | 10a308cef6fecb1d8e3b4ffd932f79d5020bec85 (patch) | |
tree | 55c5b77611ba428feb0dea4ca9736d4a00b1578e /grs | |
parent | make-worldconf: sort the sections of world.conf. (diff) | |
download | grss-10a308cef6fecb1d8e3b4ffd932f79d5020bec85.tar.gz grss-10a308cef6fecb1d8e3b4ffd932f79d5020bec85.tar.bz2 grss-10a308cef6fecb1d8e3b4ffd932f79d5020bec85.zip |
Daemon.py: add kudos.
Diffstat (limited to 'grs')
-rw-r--r-- | grs/Daemon.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/grs/Daemon.py b/grs/Daemon.py index 8fed2a1..15290a5 100644 --- a/grs/Daemon.py +++ b/grs/Daemon.py @@ -9,6 +9,8 @@ import time class Daemon: """ doc here more doc + Adopted from Sander Marechal's "A simple unix/linux daemon in Python" + See: http://www.jejik.com/articles/2007/02/a_simple_unix_linux_daemon_in_python/ """ def __init__(self, pidfile, **kwargs): @@ -41,7 +43,7 @@ class Daemon: sys.stderr.write('fork #2 failed %s\n' % err) sys.exit(1) - # Close stdin, and redirect both stdout and stderr to grs-daemon-<pid>.err + # Dup stdin to /dev/null, and stdout and stderr to grs-daemon-<pid>.err si = open(os.devnull, 'r') os.dup2(si.fileno(), sys.stdin.fileno()) |