summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--debian/bcfg2-server.init16
-rwxr-xr-xsrc/sbin/bcfg2-server6
2 files changed, 11 insertions, 11 deletions
diff --git a/debian/bcfg2-server.init b/debian/bcfg2-server.init
index e052a854f..8025b72cc 100644
--- a/debian/bcfg2-server.init
+++ b/debian/bcfg2-server.init
@@ -11,23 +11,19 @@ PIDFILE=/var/tmp/bcfg2-server.pid
case "$1" in
start)
echo -n "Starting bcfg2-server: "
- if [ -f "/etc/SuSE-release" ] ; then
- /sbin/start_daemon -p "${PIDFILE}" /usr/sbin/bcfg2-server
- elif [ -f "/etc/redhat-release" ]; then
- /usr/sbin/bcfg2-server -D "${PIDFILE}"
+ if [ -f "/etc/debian_version" ] ; then
+ /sbin/start-stop-daemon --pidfile "${PIDFILE}" --make-pidfile -b -S --startas /usr/sbin/bcfg2-server
else
- /sbin/start-stop-daemon --pidfile "${PIDFILE}" --make-pidfile -b -S --startas /usr/sbin/bcfg2-server
+ /usr/sbin/bcfg2-server -D "${PIDFILE}"
fi
echo "bcfg2-server"
;;
stop)
echo -n "Stopping bcfg2-server: "
- if [ -f "/etc/SuSE-release" ] ; then
- /sbin/killproc -p "${PIDFILE}" /usr/sbin/bcfg2-server
- elif [ -f "/etc/redhat-release" ]; then
- kill -INT `cat ${PIDFILE}`
- else
+ if [ -f "/etc/debian_version" ] ; then
/sbin/start-stop-daemon -p "${PIDFILE}" -K /usr/sbin/bcfg2-server
+ else
+ kill -INT `cat ${PIDFILE}`
fi
echo done
;;
diff --git a/src/sbin/bcfg2-server b/src/sbin/bcfg2-server
index 7d2b55f91..4fc517e76 100755
--- a/src/sbin/bcfg2-server
+++ b/src/sbin/bcfg2-server
@@ -197,7 +197,11 @@ class Bcfg2Serv(Bcfg2.Server.Component.Component):
return "<ok/>"
if __name__ == '__main__':
- Bcfg2.Logging.setup_logging('bcfg2-server')
+ if '-D' in sys.argv:
+ Bcfg2.Logging.setup_logging('bcfg2-server', to_console=False)
+ else:
+ Bcfg2.Logging.setup_logging('bcfg2-server')
+
options = {
'v':'verbose',
'd':'debug',