X-Git-Url: http://gitweb.hugovil.com/?a=blobdiff_plain;f=stage4%2Fbootscripts%2Fdbus;h=d4c77f516d3132bc64343ea3053fe37e0c46c524;hb=cf3d9a3b194a6578c881cdd4eb528398d4de2741;hp=fe6987fba2d72c02e4e76ca852652c8c53a6630b;hpb=564ec1bbb321286571c30da20b81620c33b18e6f;p=hvlinux.git diff --git a/stage4/bootscripts/dbus b/stage4/bootscripts/dbus index fe6987f..d4c77f5 100755 --- a/stage4/bootscripts/dbus +++ b/stage4/bootscripts/dbus @@ -7,8 +7,12 @@ source /etc/rc.d/init.d/functions log_script_name "$0 $*" +DAEMON=/usr/bin/dbus-daemon +DAEMON_DESC="D-BUS Messagebus daemon" +DAEMON_OPTS="--config-file=/etc/dbus-1/system.conf" + dbus_start() { - if statusproc dbus-daemon | grep -q "not running"; then + if statusproc ${DAEMON} | grep -q "stopped"; then if [ -f /var/run/dbus/pid ]; then rm /var/run/dbus/pid fi @@ -19,8 +23,8 @@ dbus_start() { echo "Already running..." return ${EXIT_CODE_WARNING} fi - - loadproc /usr/bin/dbus-daemon --config-file=/etc/dbus-1/system.conf + + loadproc ${DAEMON} ${DAEMON_OPTS} return $? } @@ -28,19 +32,19 @@ dbus_start() { case "$1" in start) - cmd_run_log_box_warn "D-Bus Messagebus Daemon start" dbus_start + cmd_run_log_box_warn "${DAEMON_DESC} start" dbus_start ;; stop) - cmd_run_log_box_warn "D-Bus Messagebus Daemon stop" killproc dbus-daemon && + cmd_run_log_box_warn "${DAEMON_DESC} stop" killproc ${DAEMON} && rm /var/run/dbus/pid && rm /var/run/dbus/system_bus_socket ;; - + status) - statusproc dbus-daemon + statusproc ${DAEMON} ;; - + restart) $0 stop sleep 1