From 59bf99cacc92b218d6f912cb922810ee5e8cd3af Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Tue, 17 Nov 2009 09:48:50 +0100 Subject: [PATCH] Add ability to run as a daemon. --- collectyd | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/collectyd b/collectyd index 95b0c42..a67dc36 100755 --- a/collectyd +++ b/collectyd @@ -3,6 +3,7 @@ import os import sys +import daemon import optparse import collecty @@ -26,4 +27,9 @@ if not c.instances: print >>sys.stderr, "Error: No instances were configured." sys.exit(1) -c.run() +if options.daemon: + with daemon.DaemonContext(stdout=sys.stdout, stderr=sys.stderr): + c.run() +else: + c.run() + -- 2.39.2