/etc/init.d/dhcpcd is in dhcpcd5 6.0.5-1.1.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 | #!/bin/sh
#
### BEGIN INIT INFO
# Provides: dhcpcd
# Required-Start: $local_fs
# Required-Stop: $local_fs
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: IPv4 DHCP client with IPv4LL support
# Description:
### END INIT INFO
PATH=/sbin:/bin:/usr/sbin:/usr/bin
DHCPCD=/sbin/dhcpcd
NAME=dhcpcd
PIDFILE=/var/run/dhcpcd.pid
test -x $DHCPCD || exit 0
INTERFACES=/etc/network/interfaces
. /lib/lsb/init-functions
sanity()
{
local x=
case "$($DHCPCD --version)" in
[1234].*)
log_failure_msg "Not running $NAME because an older version" \
"is currently preferred"
exit 6
esac
for x in /var/run/dhcpcd-*.pid; do
[ -f "$x" ] || continue
log_failure_msg "Not running $NAME because there is aleady an" \
"interface specific instance"
log_failure_msg "$x"
exit 6
done
if grep -q "^[[:space:]]*iface[[:space:]]*.*[[:space:]]*inet[[:space:]]*dhcp" \
$INTERFACES; then
log_failure_msg "Not running $NAME because $INTERFACES"
log_failure_msg "defines some interfaces that will use a" \
"DHCP client"
exit 6
fi
}
case "$1" in
start)
sanity
if pidofproc -p $PIDFILE $DHCPCD >/dev/null; then
log_warning_msg "$NAME is already running"
exit 0
fi
$DHCPCD
;;
stop)
sanity
$DHCPCD -x
;;
restart|force-reload)
sanity
$DHCPCD -x
$DHCPCD
;;
try-restart)
if ! pidofproc -p $PIDFILE $DHCPCD >/dev/null; then
log_warning_msg "$NAME is not running"
else
sanity
$DHCPCD -x
$DHCPCD
fi
;;
reload)
if ! pidofproc -p $PIDFILE $DHCPCD >/dev/null; then
log_failure_msg "$NAME is not running"
exit 7
fi
sanity
$DHCPCD -n
;;
status)
status_of_proc -p $PIDFILE $DHCPCD "$NAME" || exit $?
;;
*)
log_failure_msg "Usage: /etc/init.d/dhcpcd {start|stop|restart|try-restart|force-reload|status}"
exit 1
;;
esac
|