Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37560227
en ru br
ALT Linux repos
S:4.4.3.P1-alt1
5.0: 3.0.7-alt1
4.1: 3.0.6-alt2.M41.1
4.0: 3.0.6-alt1
3.0: 3.0.2-alt1

Group :: System/Servers
RPM: dhcp

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

#!/bin/sh

# This shell script takes care of starting and stopping dhcpd (DHCPv6).
#
# chkconfig: - 65 35
# description: \
# The Internet Software Consortium DHCPv6 Server, dhcpd, implements \
# the Dynamic Host Configuration Protocol for IPv6 (DHCPv6) and the Internet \
# Bootstrap Protocol (BOOTP). DHCPv6 allows hosts on a TCP/IP network \
# to request and be assigned IPv6 addresses, and also to discover \
# information about the network to which they are attached. BOOTP \
# provides similar functionality, with certain restrictions.
# processname: dhcpd
# config: /etc/dhcp/dhcpd6.conf
# pidfile: /var/run/dhcpd6.pid

WITHOUT_RC_COMPAT=1

# Source function library.
. /etc/init.d/functions

# Source networking configuration.
SourceIfNotEmpty /etc/sysconfig/network

PIDFILE=/var/run/dhcpd6.pid
DHCPD_CONF=/etc/dhcp/dhcpd6.conf
DHCPD_CONF_SAMPLE=/etc/dhcp/dhcpd6.conf.sample
LOCKFILE=/var/lock/subsys/dhcpd6

# Source config.
SourceIfNotEmpty /etc/sysconfig/dhcpd6

RETVAL=0

start()
{
is_yes "$NETWORKING" || return 0
if [ -e "$DHCPD_CONF" ]; then
action "Adjusting environment for dhcpd (DHCPv6):" /etc/chroot.d/dhcpd6.all ||:
start_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user dhcpd6 \
--displayname "dhcpd (DHCPv6)" -- dhcpd -6 $DHCPDARGS
RETVAL=$?
else
msg_starting "dhcpd (DHCPv6)"
printf "%s: %s" "$DHCPD_CONF" "No such file or directory"
failure "dhcpd (DHCPv6) startup"
echo
if [ -e "$DHCPD_CONF_SAMPLE" ]; then
echo "There is a sample configuration file under $DHCPD_CONF_SAMPLE" >&2
fi
RETVAL=1
fi
return $RETVAL
}

stop()
{
stop_daemon --pidfile "$PIDFILE" --lockfile "$LOCKFILE" --expect-user dhcpd6 \
--displayname "dhcpd (DHCPv6)" -- dhcpd
RETVAL=$?
return $RETVAL
}

restart()
{
stop
start
}

# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
reload|restart)
restart
;;
condstop)
if [ -e "$LOCKFILE" ]; then
stop
fi
;;
condreload|condrestart)
if [ -e "$LOCKFILE" ]; then
restart
fi
;;
status)
status --pidfile "$PIDFILE" --expect-user dhcpd6 --displayname "dhcpd (DHCPv6)" -- dhcpd
RETVAL=$?
;;
*)
msg_usage "${0##*/} {start|stop|restart|condstop|condrestart|status}"
RETVAL=1
esac

exit $RETVAL
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin