3 # dhcdbd DHCP Client D-BUS Daemon
6 # description: dhcdbd provides D-BUS control of the ISC DHCP client, dhclient,
7 # and D-BUS access to the DHCP options obtained by dhclient
8 # for each IPv4 interface.
10 # pidfile: /var/run/dhcdbd.pid
11 # config: /etc/dbus-1/system.d/dhcdbd.conf
14 # Source function library
15 . /etc/rc.d/init.d/functions
18 . /etc/sysconfig/network
21 [ -f /etc/sysconfig/dhcdbd ] && . /etc/sysconfig/dhcdbd
23 # Check that networking is up.
24 if is_yes "${NETWORKING}"; then
25 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
26 msg_network_down dhcdbd
34 # See how we were called.
37 if [ -f /var/lock/subsys/messagebus ]; then
38 if [ ! -f /var/lock/subsys/dhcdbd ]; then
40 daemon /usr/sbin/dhcdbd --system
42 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/dhcdbd
44 msg_already_running dhcdbd
47 msg_not_running messagebus
52 if [ -f /var/run/dhcdbd.pid ]; then
53 checkpid `cat /var/run/dhcdbd.pid` >/dev/null 2>&1
55 rm -f /var/lock/subsys/dhcdbd /var/run/dhcdbd.pid >/dev/null 2>&1
60 if [ -f /var/lock/subsys/messagebus ]; then
61 if [ -f /var/lock/subsys/dhcdbd ]; then
64 --dest=com.redhat.dhcp \
67 --reply-timeout=20000 \
69 com.redhat.dhcp.quit >/dev/null 2>&1
71 rm -f /var/lock/subsys/dhcdbd /var/run/dhcdbd.pid >/dev/null 2>&1
75 msg_not_running dhcdbd
78 msg_not_running messagebus
84 pid=`cat /var/run/dhcdbd.pid`
85 if [ $? -eq 0 -a -n "$pid" ]; then
86 sender=`/usr/bin/dbus-send \
88 --dest=com.redhat.dhcp \
91 --reply-timeout=20000 \
93 com.redhat.dhcp.ping |
94 grep 'sender=' | sed 's/^.*sender=//;s/\ .*$//'`
96 echo 'it is listening on '$sender
106 msg_usage "$0 {start|stop|restart|status}"