#!/sbin/runscript # Copyright 2006 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 depend() { need net dbus } start() { ebegin "Starting dhcdbd" start-stop-daemon --start --quiet --pidfile /var/run/dhcdbd.pid \ --startas ${DAEMON} -- ${DAEMON_ARGS} eend $? "Failed to start dhcdbd" } stop() { ebegin "Stopping dhcdbd" # Try to shutdown using the DBUS subsystem /usr/bin/dbus-send --system --dest=com.redhat.dhcp --type=method_call \ --print-reply --reply-timeout=20000 /com/redhat/dhcp \ com.redhat.dhcp.quit > /dev/null 2>&1 # We can always resort to violence if [[ $? -ne 0 ]] ; then start-stop-daemon --stop --quiet --pidfile /var/run/dhcdbd.pid \ --signal TERM eend $? "Failed to stop dhcdbd" fi # Cleanup stale pid files [ -f /var/run/dhcdbd.pid ] && rm -f /var/run/dhcdbd.pid } restart() { ebegin "Restarting dhcdbd" svc_stop; svc_start eend $? "Failed to restart dhcdbd" }