diff options
author | Narayan Desai <desai@mcs.anl.gov> | 2009-05-07 01:18:18 +0000 |
---|---|---|
committer | Narayan Desai <desai@mcs.anl.gov> | 2009-05-07 01:18:18 +0000 |
commit | 22f1fc04c210094ce8660928f91cd63f3163c31a (patch) | |
tree | 87dd4a383f352b533cedc88c979ab54a74ca11f8 /src | |
parent | 50b3e9287b1ef9646da8632ca223270ea86d7800 (diff) | |
download | bcfg2-22f1fc04c210094ce8660928f91cd63f3163c31a.tar.gz bcfg2-22f1fc04c210094ce8660928f91cd63f3163c31a.tar.bz2 bcfg2-22f1fc04c210094ce8660928f91cd63f3163c31a.zip |
remove stale code
git-svn-id: https://svn.mcs.anl.gov/repos/bcfg/trunk/bcfg2@5204 ce84e21b-d406-0410-9b95-82705330c041
Diffstat (limited to 'src')
-rw-r--r-- | src/lib/Daemon.py | 48 | ||||
-rwxr-xr-x | src/sbin/bcfg2-server | 1 |
2 files changed, 0 insertions, 49 deletions
diff --git a/src/lib/Daemon.py b/src/lib/Daemon.py deleted file mode 100644 index 8798c7461..000000000 --- a/src/lib/Daemon.py +++ /dev/null @@ -1,48 +0,0 @@ -'''Bcfg2 daemon support''' -__revision__ = '$Revision$' - -import os -import sys - -def daemonize(filename): - '''Do the double fork/setsession dance''' - # Check if the pid is active - try: - pidfile = open(filename, "r") - oldpid = int(pidfile.readline()) - # getpgid() will retun an IO error if all fails - os.getpgid(oldpid) - pidfile.close() - - # If we got this far without exceptions, there is another instance - # running. Exit gracefully. - print("PID File (%s) exists and listed PID (%d) is active." % \ - (filename, oldpid)) - raise SystemExit(1) - except OSError: - pidfile.close() - except (IOError, ValueError): - # pid file doesn't - pass - - # Fork once - if os.fork() != 0: - os._exit(0) - os.setsid() # Create new session - pid = os.fork() - if pid != 0: - try: - pidfile = open(filename, "w") - pidfile.write("%i" % pid) - pidfile.close() - except: - print("Failed to write pid file %s" % filename) - os._exit(0) - os.chdir("/") - os.umask(0) - - null = open("/dev/null", "w+") - - os.dup2(null.fileno(), sys.__stdin__.fileno()) - os.dup2(null.fileno(), sys.__stdout__.fileno()) - os.dup2(null.fileno(), sys.__stderr__.fileno()) diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server index efa484e63..a111cd9a4 100755 --- a/src/sbin/bcfg2-server +++ b/src/sbin/bcfg2-server @@ -10,7 +10,6 @@ from xmlrpclib import Fault import Bcfg2.Logger import Bcfg2.Options import Bcfg2.Component -import Bcfg2.Daemon import Bcfg2.Server.Plugins.Metadata from Bcfg2.Server.Core import CoreInitError import Bcfg2.Server.XMLRPC |