- Updated to ISC DHCP 4.1.1, the current 4.x series production
release, providing DHCPv6 client/server/relay implementation. The programs act in DHCPv6 mode, when the -6 start option is set. We install separate init scripts with a 6 at the end to handle them, that is /etc/init.d/dhcpd6 and dhrelay6. Further, there is also a link to the binaries with a 6 at the end, e.g. dhclient6, making it visible, that the installed version supports DHCPv6. - Moved additional documentation to a separate dhcp-doc package. - Changed to provide config files and scripts as source files instead of patches to the ISC scripts. - Adopted spec file and config/scripts, merged in all patches. - Implemented RFC 3442 classless static routes support in the dhclient-script (bnc#555870). OBS-URL: https://build.opensuse.org/package/show/network:dhcp/dhcp?expand=0&rev=15
This commit is contained in:
parent
0815f289e0
commit
b6b28d718d
@ -1,5 +1,5 @@
|
|||||||
## Name: DHCP Server
|
## Name: DHCPv4 Server
|
||||||
## Description: Opens ports for ISC DHCP Server.
|
## Description: Opens ports for ISC DHCPv4 4.x Server.
|
||||||
#
|
#
|
||||||
# For a more detailed description of the individual variables see
|
# For a more detailed description of the individual variables see
|
||||||
# the comments for FW_SERVICES_*_EXT in /etc/sysconfig/SuSEfirewall2
|
# the comments for FW_SERVICES_*_EXT in /etc/sysconfig/SuSEfirewall2
|
||||||
|
3
contrib.tar.gz
Normal file
3
contrib.tar.gz
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:699a861ef8be1a62fe1efa802ae71d9045b55bfc61b4cd76c34f94e47be4952e
|
||||||
|
size 8333
|
637
dhclient-script
Normal file
637
dhclient-script
Normal file
@ -0,0 +1,637 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
#
|
||||||
|
# /sbin/dhclient-script for openSUSE / SUSE Linux Enterprise Server
|
||||||
|
# based on the scripts shipped with the ISC DHCP (4.1.1) client.
|
||||||
|
#
|
||||||
|
# Note:
|
||||||
|
# It is used by sysconfig alias netcontrol alias ifup-dhcp,
|
||||||
|
# but not by the NetworkManager that is using an own script.
|
||||||
|
#
|
||||||
|
# Copyright (C) 2010 SUSE LINUX Products GmbH / Novell Inc.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||||
|
# Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
# Author: Marius Tomaschewski <mt@suse.de>
|
||||||
|
#
|
||||||
|
|
||||||
|
##
|
||||||
|
## check mandatory parameters or ignore & exit
|
||||||
|
##
|
||||||
|
test "x$reason" = x -o "x$interface" = x && exit 1
|
||||||
|
|
||||||
|
#
|
||||||
|
# source sysconfig functions
|
||||||
|
#
|
||||||
|
SYSCONFIG_CFG_DIR="/etc/sysconfig/network"
|
||||||
|
. "$SYSCONFIG_CFG_DIR/scripts/functions"
|
||||||
|
SYSCONFIG_RUN_DIR=${SYSCONFIG_RUN_DIR:-/dev/.sysconfig/network}
|
||||||
|
|
||||||
|
#
|
||||||
|
# Debugging:
|
||||||
|
# logs entire run of dhclient-script to /var/log/${dhclient}-script.*.log,
|
||||||
|
# when DHCLIENT_DEBUG/DHCLIENT6_DEBUG are "yes" in sysconfig/network/dhcp
|
||||||
|
#
|
||||||
|
eval `grep '^DHCLIENT6\?_DEBUG=' "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
|
||||||
|
case $reason in
|
||||||
|
*6) DEBUG=$DHCLIENT6_DEBUG ; dhclient=dhclient6 ; ipver=6 ;;
|
||||||
|
*) DEBUG=$DHCLIENT_DEBUG ; dhclient=dhclient ; ipver=4 ;;
|
||||||
|
esac
|
||||||
|
if [ "$DEBUG" = yes ]; then
|
||||||
|
set -a # allexport
|
||||||
|
(
|
||||||
|
echo '****************'
|
||||||
|
echo "$0 $*"
|
||||||
|
date
|
||||||
|
echo '----------------'
|
||||||
|
env
|
||||||
|
echo '----------------'
|
||||||
|
) >> /var/log/${dhclient}-script.$interface.log
|
||||||
|
exec 2>> /var/log/${dhclient}-script.$interface.log
|
||||||
|
set +a
|
||||||
|
set -x
|
||||||
|
fi
|
||||||
|
|
||||||
|
is_ifup_controlled()
|
||||||
|
{
|
||||||
|
test -f "$SYSCONFIG_RUN_DIR/if-${interface}"
|
||||||
|
}
|
||||||
|
# netconfig makes all "additional" modifications as DNS or NTP
|
||||||
|
netconfig_modify() {
|
||||||
|
if test -x /sbin/netconfig -a -n "$interface" ; then
|
||||||
|
{
|
||||||
|
echo "INTERFACE='$interface'"
|
||||||
|
for v in ${!new_*}; do
|
||||||
|
case $ipver in
|
||||||
|
6)
|
||||||
|
case $v in
|
||||||
|
(new_ip6_address) k='IPADDR' ;;
|
||||||
|
(new_ip6_prefixlen) k='PREFIXLEN' ;;
|
||||||
|
(new_dhcp6_client_id) k='DHCP6CID' ;;
|
||||||
|
(new_dhcp6_server_id) k='DHCP6SID' ;;
|
||||||
|
(new_dhcp6_domain_search) k='DNSSEARCH' ;;
|
||||||
|
(new_dhcp6_name_servers) k='DNSSERVERS' ;;
|
||||||
|
(*) k="dhclient6_${v#new_}" ;;
|
||||||
|
esac
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
case $v in
|
||||||
|
(new_ip_address) k='IPADDR' ;;
|
||||||
|
(new_subnet_mask) k='NETMASK' ;;
|
||||||
|
(new_network_number) k='NETWORK' ;;
|
||||||
|
(new_broadcast_address) k='BROADCAST' ;;
|
||||||
|
(new_interface_mtu) k='MTU' ;;
|
||||||
|
(new_rfc3442_classless_static_routes)
|
||||||
|
k='ROUTES' ;;
|
||||||
|
# (new_static_routes) k='ROUTES' ;;
|
||||||
|
(new_routers) k='GATEWAYS' ;;
|
||||||
|
(new_host_name) k='HOSTNAME' ;;
|
||||||
|
(new_domain_search) k='DNSSEARCH' ;;
|
||||||
|
(new_domain_name) k='DNSDOMAIN' ;;
|
||||||
|
(new_domain_name_servers) k='DNSSERVERS' ;;
|
||||||
|
(new_ntp_servers) k='NTPSERVERS' ;;
|
||||||
|
(new_nis_domain) k='NISDOMAIN' ;;
|
||||||
|
(new_nis_servers) k='NISSERVERS' ;;
|
||||||
|
(new_root_path) k='ROOTPATH' ;;
|
||||||
|
(new_dhcp_server_identifier)k='DHCPSID' ;;
|
||||||
|
(new_lpr_servers) k='LPRSERVER' ;;
|
||||||
|
(new_log_servers) k='LOGSERVER' ;;
|
||||||
|
(new_netbios_dd_server) k='NETBIOSDDSERVER' ;;
|
||||||
|
(new_netbios_name_servers) k='NETBIOSNAMESERVER' ;;
|
||||||
|
(new_netbios_node_type) k='NETBIOSNODETYPE' ;;
|
||||||
|
(new_netbios_scope) k='NETBIOSSCOPE' ;;
|
||||||
|
(*) k="dhclient_${v#new_}" ;;
|
||||||
|
esac
|
||||||
|
esac
|
||||||
|
[ "k${k}" != k ] && echo "${k}='${!v}'"
|
||||||
|
done
|
||||||
|
} | /sbin/netconfig modify -s "dhclient$ipver" -i "$interface"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
netconfig_remove() {
|
||||||
|
if test -x /sbin/netconfig -a -n "$interface" ; then
|
||||||
|
/sbin/netconfig remove -s "dhclient$ipver" -i "$interface" </dev/null
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
parse_ipv4_classless_routes()
|
||||||
|
{
|
||||||
|
local route_regex='^[0-9]{1,3}([ ][0-9]{1,3}){4,}$'
|
||||||
|
local rfc_routes=() _routes=()
|
||||||
|
|
||||||
|
# check whether it is a list of numbers
|
||||||
|
[[ $* =~ $route_regex ]] && rfc_routes=($*)
|
||||||
|
|
||||||
|
for (( i=0; i < ${#rfc_routes[@]}; )) ; do
|
||||||
|
net_length=${rfc_routes[$i]}
|
||||||
|
test $net_length -gt 32 && return 1
|
||||||
|
|
||||||
|
((i++))
|
||||||
|
net_octets=$(($net_length / 8 + ($net_length % 8 ? 1 : 0)))
|
||||||
|
test ${#rfc_routes[@]} -lt $(( $i + $net_octets + 4 )) && \
|
||||||
|
return 1
|
||||||
|
|
||||||
|
net_netmask=$(pfxlen2mask $net_length)
|
||||||
|
net_netmask=(${net_netmask//./ })
|
||||||
|
net_address=(0 0 0 0)
|
||||||
|
for(( j=0; j < $net_octets; j++, i++)); do
|
||||||
|
net_address[$j]=$((${rfc_routes[$i]} & ${net_netmask[$j]}))
|
||||||
|
done
|
||||||
|
|
||||||
|
gateway=(0 0 0 0)
|
||||||
|
for (( j=0; j < 4; j++, i++ )); do
|
||||||
|
gateway[$j]=${rfc_routes[$i]}
|
||||||
|
done
|
||||||
|
|
||||||
|
old_IFS=$IFS
|
||||||
|
IFS='.'
|
||||||
|
_routes+=("${net_address[*]},${net_netmask[*]},${gateway[*]}")
|
||||||
|
IFS=$old_IFS
|
||||||
|
done
|
||||||
|
|
||||||
|
echo "${_routes[*]}"
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
set_ipv4_route()
|
||||||
|
{
|
||||||
|
local dest=$1 ; shift
|
||||||
|
local mask=$1 ; shift
|
||||||
|
local gate=("$@")
|
||||||
|
local hops args
|
||||||
|
|
||||||
|
hops=()
|
||||||
|
if [ ${#gate[@]} -gt 1 ] ; then
|
||||||
|
for((g=0; g<${#gate[@]}; g++)) ; do
|
||||||
|
hops+=(nexthop ${gate[$g]:+via ${gate[$g]}}
|
||||||
|
dev $interface weight $((g+1)))
|
||||||
|
done
|
||||||
|
elif [ ${#gate[@]} -gt 0 ] ; then
|
||||||
|
hops+=(${gate[$g]:+via ${gate[$g]}} dev $interface)
|
||||||
|
fi
|
||||||
|
[ ${#hops[@]} -eq 0 ] && hops=(dev $interface)
|
||||||
|
args=("$dest${mask:+/$mask}" $metric_arg ${hops[*]})
|
||||||
|
|
||||||
|
err=`LC_ALL=C /sbin/ip route replace ${args[*]} 2>&1` && return 0
|
||||||
|
case $err in
|
||||||
|
RTNETLINK*answers:*File*exists) ;;
|
||||||
|
RTNETLINK*answers:*No*such*process)
|
||||||
|
#
|
||||||
|
# The gateway seems to be not reachable via local network
|
||||||
|
# route (implicitly created by ifconfig based on the IP
|
||||||
|
# and netmask provided by dhcp).
|
||||||
|
# Check this, set an explicit host route to the gateway
|
||||||
|
# over the current interface and try again (bnc#266215).
|
||||||
|
#
|
||||||
|
retry=0
|
||||||
|
for router in ${gate[@]} ; do
|
||||||
|
matches=$(/sbin/ip -f inet -o route list match $router | \
|
||||||
|
grep -v ^default | grep -c -v "^$" 2>/dev/null)
|
||||||
|
if [ -n "$matches" -a $(($matches)) -eq 0 ] ; then
|
||||||
|
LC_ALL=C /sbin/ip route add $router/32 dev $interface || retry=1
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
if [ $retry -eq 0 ] ; then
|
||||||
|
LC_ALL=C /sbin/ip route replace ${args[*]} && return 0
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
return 1
|
||||||
|
}
|
||||||
|
get_ipv4_default_gw()
|
||||||
|
{
|
||||||
|
if [ "x$new_rfc3442_classless_static_routes" != x ] ; then
|
||||||
|
local r route=() gw=()
|
||||||
|
for r in $new_rfc3442_classless_static_routes ; do
|
||||||
|
route=(${r//,/ })
|
||||||
|
case ${route[0]}/${route[1]} in
|
||||||
|
0.0.0.0/0.0.0.0)
|
||||||
|
[ "x${route[2]}" = "x0.0.0.0" ] || \
|
||||||
|
gw+=(${route[2]})
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
echo "${gw[*]}"
|
||||||
|
elif [ "$new_routers" != x ] ; then
|
||||||
|
echo "$new_routers"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
set_ipv4_routes()
|
||||||
|
{
|
||||||
|
if [ "x$new_rfc3442_classless_static_routes" != x ] ; then
|
||||||
|
local r route=()
|
||||||
|
# TODO: multiple gw's to one dest as in $new_routers?
|
||||||
|
for r in $new_rfc3442_classless_static_routes ; do
|
||||||
|
route=(${r//,/ })
|
||||||
|
case ${route[0]}/${route[1]} in
|
||||||
|
0.0.0.0/0.0.0.0)
|
||||||
|
[ "x$DHCLIENT_SET_DEFAULT_ROUTE" = xyes ] || continue ;;
|
||||||
|
esac
|
||||||
|
set_ipv4_route ${route[*]}
|
||||||
|
done
|
||||||
|
elif [ "$new_routers" != x ] ; then
|
||||||
|
if [ "x$DHCLIENT_SET_DEFAULT_ROUTE" = xyes ] ; then
|
||||||
|
set_ipv4_route default "" $new_routers
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
set_ipv6_routes()
|
||||||
|
{
|
||||||
|
: TODO
|
||||||
|
}
|
||||||
|
set_hostname()
|
||||||
|
{
|
||||||
|
if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then
|
||||||
|
current_hostname=`hostname`
|
||||||
|
if [ "x${current_hostname%%.*}" = "x" ] || \
|
||||||
|
[ "x${current_hostname%%.*}" = "x(none)" ] || \
|
||||||
|
[ "x${current_hostname%%.*}" = "xlocalhost" ] || \
|
||||||
|
[ "x${current_hostname%%.*}" != "x${new_host_name%%.*}" ]; then
|
||||||
|
|
||||||
|
if [ "x${new_host_name%%.*}" != "x" ]; then
|
||||||
|
hostname "${new_host_name%%.*}"
|
||||||
|
else
|
||||||
|
if [ -x /usr/bin/host ] ; then
|
||||||
|
if out=`host -W 2 "$new_ip_address" 2>/dev/null` ; then
|
||||||
|
_hostname="`echo "$out" | sed 's:^.* ::; s:\..*::'`"
|
||||||
|
if [ "x${_hostname}" != "x" -a \
|
||||||
|
"x${_hostname}" != "x${current_hostname%%.*}" ]; then
|
||||||
|
hostname "${_hostname}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
# check regardless the DHCLIENT_SET_HOSTNAME setting
|
||||||
|
# and whether we've set it above or not, because when
|
||||||
|
# it changed, we've to handle it anyway...
|
||||||
|
local OLD_HOSTNAME=`read_cached_config_data hostname $interface`
|
||||||
|
local CUR_HOSTNAME=`hostname 2>/dev/null`
|
||||||
|
if test "x$OLD_HOSTNAME" != "x$CUR_HOSTNAME" ; then
|
||||||
|
write_cached_config_data hostname "$CUR_HOSTNAME" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
|
||||||
|
# reload syslog so it knows the new hostname
|
||||||
|
/etc/init.d/syslog reload
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
|
||||||
|
exit_with_hooks() {
|
||||||
|
exit_status=$1
|
||||||
|
if [ -f /etc/${dhclient}-exit-hooks ]; then
|
||||||
|
. /etc/${dhclient}-exit-hooks
|
||||||
|
fi
|
||||||
|
# probably should do something with exit status of the local script
|
||||||
|
exit $exit_status
|
||||||
|
}
|
||||||
|
|
||||||
|
# Invoke the local dhcp client enter hooks, if they exist.
|
||||||
|
if [ -f /etc/${dhclient}-enter-hooks ]; then
|
||||||
|
exit_status=0
|
||||||
|
. /etc/${dhclient}-enter-hooks
|
||||||
|
# allow the local script to abort processing of this state
|
||||||
|
# local script must set exit_status variable to nonzero.
|
||||||
|
if [ $exit_status -ne 0 ]; then
|
||||||
|
exit $exit_status
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
case $dhclient in
|
||||||
|
dhclient)
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
# STARTMODE
|
||||||
|
eval `grep --no-filename \
|
||||||
|
'^[[:space:]]*STARTMODE=' \
|
||||||
|
"$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
||||||
|
tmp_startmode=`read_cached_config_data startmode $INTERFACE`
|
||||||
|
[ -n "$tmp_startmode" ] && STARTMODE="$tmp_startmode"
|
||||||
|
|
||||||
|
# DHCLIENT_SET_HOSTNAME and DHCLIENT_SET_DEFAULT_ROUTE
|
||||||
|
if grep -qs '^primary=yes' "$SYSCONFIG_RUN_DIR/if-${interface}" 2>/dev/null ;
|
||||||
|
then
|
||||||
|
eval `grep --no-filename \
|
||||||
|
'^[[:space:]]*DHCLIENT_SET_\(HOSTNAME\|DEFAULT_ROUTE\)=' \
|
||||||
|
"$SYSCONFIG_CFG_DIR/dhcp"
|
||||||
|
"$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
||||||
|
else
|
||||||
|
eval `grep --no-filename \
|
||||||
|
'^[[:space:]]*DHCLIENT_SET_\(HOSTNAME\|DEFAULT_ROUTE\)=' \
|
||||||
|
"$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
STARTMODE=manual
|
||||||
|
eval `grep --no-filename \
|
||||||
|
'^[[:space:]]*DHCLIENT_SET_\(HOSTNAME\|DEFAULT_ROUTE\)=' \
|
||||||
|
"$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
|
||||||
|
fi
|
||||||
|
if [ "x$new_rfc3442_classless_static_routes_raw" != x ] ; then
|
||||||
|
new_rfc3442_classless_static_routes=$(
|
||||||
|
parse_ipv4_classless_routes $new_rfc3442_classless_static_routes_raw
|
||||||
|
)
|
||||||
|
else
|
||||||
|
unset new_rfc3442_classless_static_routes
|
||||||
|
fi
|
||||||
|
if [ x$new_broadcast_address != x ] ; then
|
||||||
|
new_broadcast_arg="brd $new_broadcast_address"
|
||||||
|
elif [ "x$new_subnet_mask" != "x255.255.255.255" ] ; then
|
||||||
|
new_broadcast_arg="brd +"
|
||||||
|
fi
|
||||||
|
if [ x$new_interface_mtu != x -a \
|
||||||
|
$(( $new_interface_mtu )) -lt 576 ] ;
|
||||||
|
then
|
||||||
|
# 68 is the minimal legal value, but 576 the real life minimum
|
||||||
|
unset new_interface_mtu
|
||||||
|
fi
|
||||||
|
if [ x$IF_METRIC != x ]; then
|
||||||
|
metric_arg="metric $IF_METRIC"
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
dhclient6)
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
# STARTMODE
|
||||||
|
eval `grep --no-filename \
|
||||||
|
'^[[:space:]]*STARTMODE=' \
|
||||||
|
"$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
||||||
|
tmp_startmode=`read_cached_config_data startmode $INTERFACE`
|
||||||
|
[ -n "$tmp_startmode" ] && STARTMODE="$tmp_startmode"
|
||||||
|
else
|
||||||
|
STARTMODE=manual
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
case $reason in
|
||||||
|
######################################################################
|
||||||
|
## DHCPv4 #
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
MEDIUM)
|
||||||
|
####################################################################
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
PREINIT)
|
||||||
|
####################################################################
|
||||||
|
if [ "x$alias_ip_address" != x ]; then
|
||||||
|
/sbin/ip addr del $alias_ip_address/$alias_subnet_mask dev $interface
|
||||||
|
fi
|
||||||
|
if [ "x$STARTMODE" != "xnfsroot" ] ; then
|
||||||
|
/sbin/ip -4 addr flush dev $interface
|
||||||
|
fi
|
||||||
|
/sbin/ip link set $interface up
|
||||||
|
|
||||||
|
# We need to give the kernel some time to get the interface up.
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
ARPCHECK|ARPSEND)
|
||||||
|
####################################################################
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
BOUND|RENEW|REBIND|REBOOT)
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
if [ x$old_ip_address != x -a x$alias_ip_address != x ] && \
|
||||||
|
[ x$alias_ip_address != x$old_ip_address ] ;
|
||||||
|
then
|
||||||
|
# Possible new alias. Remove old alias.
|
||||||
|
/sbin/ip addr del $alias_ip_address/$alias_subnet_mask dev $interface
|
||||||
|
fi
|
||||||
|
if [ x$old_ip_address != x -a x$old_ip_address != x$new_ip_address ]; then
|
||||||
|
# IP address changed. Flush to clear routes and ARP cache.
|
||||||
|
if [ "x$STARTMODE" != "xnfsroot" ] ; then
|
||||||
|
/sbin/ip -4 addr flush dev $interface
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x$new_interface_mtu != x ] ; then
|
||||||
|
/sbin/ip link set $interface mtu $new_interface_mtu
|
||||||
|
fi
|
||||||
|
if [ x$new_ip_address != x -a x$old_ip_address != x$new_ip_address ] || \
|
||||||
|
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
|
||||||
|
|
||||||
|
/sbin/ip addr add $new_ip_address/$new_subnet_mask \
|
||||||
|
${new_broadcast_arg} \
|
||||||
|
dev $interface
|
||||||
|
|
||||||
|
set_ipv4_routes
|
||||||
|
fi
|
||||||
|
if [ x$new_ip_address != x$alias_ip_address -a x$alias_ip_address != x ];
|
||||||
|
then
|
||||||
|
/sbin/ip addr add $alias_ip_address/$alias_subnet_mask \
|
||||||
|
dev $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
netconfig_modify
|
||||||
|
|
||||||
|
if [ x$old_ip_address != x -a x$old_ip_address != x$new_ip_address ]; then
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
ifdown $interface -o dhcp
|
||||||
|
|
||||||
|
write_cached_config_data dhcp4_state "new" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
write_cached_config_data dhcp4_state "up" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
set_hostname
|
||||||
|
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
# execute ifservice and if-up.d scripts
|
||||||
|
ifup $interface -o dhcp
|
||||||
|
|
||||||
|
write_cached_config_data dhcp4_state "complete" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
EXPIRE|FAIL|RELEASE|STOP)
|
||||||
|
####################################################################
|
||||||
|
if [ x$old_ip_address != x ]; then
|
||||||
|
if [ "x$STARTMODE" != "xnfsroot" ] ; then
|
||||||
|
/sbin/ip -4 addr flush dev $interface
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
if [ x$alias_ip_address != x ]; then
|
||||||
|
/sbin/ip addr add $alias_ip_address/$alias_subnet_mask \
|
||||||
|
dev $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
write_cached_config_data dhcp4_state "down" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
netconfig_remove
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
TIMEOUT)
|
||||||
|
####################################################################
|
||||||
|
if [ x$alias_ip_address != x ]; then
|
||||||
|
/sbin/ip addr del $alias_ip_address/$alias_subnet_mask \
|
||||||
|
dev $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ x$new_ip_address != x -a x$old_ip_address != x$new_ip_address ];
|
||||||
|
then
|
||||||
|
/sbin/ip addr add $new_ip_address/$new_subnet_mask \
|
||||||
|
${new_broadcast_arg} \
|
||||||
|
dev $interface
|
||||||
|
|
||||||
|
set -- $(get_ipv4_default_gw)
|
||||||
|
if [ -n "$1" ] && /sbin/arping -q -c 1 -w 5 -I $interface $1 ;
|
||||||
|
then
|
||||||
|
if [ x$new_ip_address != x$alias_ip_address ] && \
|
||||||
|
[ x$alias_ip_address != x ]; then
|
||||||
|
/sbin/ip addr add $alias_ip_address/$alias_subnet_arg
|
||||||
|
fi
|
||||||
|
|
||||||
|
set_ipv4_routes
|
||||||
|
|
||||||
|
netconfig_modify
|
||||||
|
|
||||||
|
set_hostname
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
# execute ifservice and if-up.d scripts
|
||||||
|
ifup $interface -o dhcp
|
||||||
|
|
||||||
|
write_cached_config_data dhcp4_state "complete" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
else
|
||||||
|
if [ x$old_ip_address != x ]; then
|
||||||
|
if [ "x$STARTMODE" != "xnfsroot" ] ; then
|
||||||
|
/sbin/ip -4 addr flush dev $interface
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
write_cached_config_data dhcp4_state "down" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
netconfig_remove
|
||||||
|
|
||||||
|
exit_with_hooks 1
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
|
||||||
|
|
||||||
|
######################################################################
|
||||||
|
## DHCPv6 #
|
||||||
|
######################################################################
|
||||||
|
|
||||||
|
PREINIT6)
|
||||||
|
####################################################################
|
||||||
|
if [ "x$STARTMODE" != "xnfsroot" ] ; then
|
||||||
|
/sbin/ip -6 addr flush dev $interface scope global permanent
|
||||||
|
fi
|
||||||
|
/sbin/ip link set $interface up
|
||||||
|
|
||||||
|
# We need to give the kernel some time to get the interface up.
|
||||||
|
sleep 1
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
BOUND6|RENEW6|REBIND6|REBOOT6)
|
||||||
|
####################################################################
|
||||||
|
|
||||||
|
if [ x$old_ip6_address != x -a x$old_ip6_address != x$new_ip6_address ];
|
||||||
|
then
|
||||||
|
|
||||||
|
/sbin/ip addr del "$old_ip6_address/$old_ip6_prefixlen" dev $interface
|
||||||
|
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
write_cached_config_data dhcp6_state "new" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
write_cached_config_data dhcp6_state "up" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "x$new_ip6_address" != x -a "x$new_ip6_prefixlen" != x ] ; then
|
||||||
|
/sbin/ip addr add "$new_ip6_address/$new_ip6_prefixlen" \
|
||||||
|
dev $interface scope global
|
||||||
|
|
||||||
|
set_ipv6_routes
|
||||||
|
fi
|
||||||
|
|
||||||
|
netconfig_modify
|
||||||
|
if [ x$old_ip6_address != x -a x$old_ip6_address != x$new_ip_address ];
|
||||||
|
then
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
/sbin/ifdown $interface -o dhcp
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
#set_hostname
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
# execute ifservice and if-up.d scripts
|
||||||
|
/sbin/ifup $interface -o dhcp
|
||||||
|
|
||||||
|
write_cached_config_data dhcp6_state "complete" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
DEPREF6)
|
||||||
|
####################################################################
|
||||||
|
if [ x$new_ip6_address = x -o x$new_ip6_prefixlen = x ] ; then
|
||||||
|
exit_with_hooks 2
|
||||||
|
fi
|
||||||
|
|
||||||
|
/sbin/ip addr change "$new_ip6_address/$new_ip6_prefixlen" \
|
||||||
|
dev $interface scope global preferred_lft 0
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
|
||||||
|
EXPIRE6|RELEASE6|STOP6)
|
||||||
|
####################################################################
|
||||||
|
if [ x$old_ip6_address != x -a x$old_ip6_prefixlen != x ] ; then
|
||||||
|
/sbin/ip addr del "$old_ip6_address/$old_ip6_prefixlen" \
|
||||||
|
dev $interface
|
||||||
|
fi
|
||||||
|
|
||||||
|
if is_ifup_controlled ; then
|
||||||
|
write_cached_config_data dhcp6_state "down" $interface
|
||||||
|
commit_cached_config_data $interface
|
||||||
|
fi
|
||||||
|
netconfig_remove
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
exit_with_hooks 0
|
57
dhclient.conf
Normal file
57
dhclient.conf
Normal file
@ -0,0 +1,57 @@
|
|||||||
|
#
|
||||||
|
# /etc/dhclient.conf -- dhclient configuration file
|
||||||
|
# See "man dhclient.conf" for further details
|
||||||
|
#
|
||||||
|
|
||||||
|
######################################################
|
||||||
|
# Sometimes, a special configuration is required for
|
||||||
|
# e.g. Cable Modem providers (@Home -- TCI).
|
||||||
|
# For example, it may be required to send out a special
|
||||||
|
# dhcp-client-identifier or to override some settings.
|
||||||
|
#
|
||||||
|
# Uncomment and fill in the appropriate settings:
|
||||||
|
#
|
||||||
|
#send dhcp-client-identifier "c32423-a"
|
||||||
|
# or as hex octets
|
||||||
|
#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
|
||||||
|
#
|
||||||
|
# Note, that hostname is usually send using -H option.
|
||||||
|
#send host-name "andare.fugue.com";
|
||||||
|
#
|
||||||
|
#supersede domain-name "fugue.com home.vix.com";
|
||||||
|
#prepend domain-name-servers 127.0.0.1;
|
||||||
|
#
|
||||||
|
#####################################################
|
||||||
|
|
||||||
|
# uncomment to request a specific lease time, otherwise
|
||||||
|
# the dhcp server will provide its default lease time:
|
||||||
|
#send dhcp-lease-time 3600;
|
||||||
|
|
||||||
|
#
|
||||||
|
# define classless static route option
|
||||||
|
#
|
||||||
|
option rfc3442-classless-static-routes_raw code 121 = array of unsigned integer 8;
|
||||||
|
|
||||||
|
# Request several well known/usefull dhcp options.
|
||||||
|
request subnet-mask, broadcast-address, routers,
|
||||||
|
rfc3442-classless-static-routes,
|
||||||
|
interface-mtu, host-name, domain-name,
|
||||||
|
domain-name-servers, nis-domain, nis-servers,
|
||||||
|
nds-context, nds-servers, nds-tree-name,
|
||||||
|
netbios-name-servers, netbios-dd-server,
|
||||||
|
netbios-node-type, netbios-scope, ntp-servers;
|
||||||
|
|
||||||
|
# We request above options, require only the IP configuration:
|
||||||
|
require subnet-mask;
|
||||||
|
# All another options (DNS, NTP, NIS, ...) are applied using
|
||||||
|
# netconfig(8) modules.
|
||||||
|
|
||||||
|
# To enforce the availability of the dns server list, set to:
|
||||||
|
#require subnet-mask, domain-name-servers;
|
||||||
|
|
||||||
|
timeout 60;
|
||||||
|
retry 60;
|
||||||
|
reboot 10;
|
||||||
|
select-timeout 5;
|
||||||
|
initial-interval 2;
|
||||||
|
|
9
dhclient6.conf
Normal file
9
dhclient6.conf
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Client configuration file example for DHCPv6
|
||||||
|
|
||||||
|
# The client side command to enable rapid-commit (2 packet exchange)
|
||||||
|
##send dhcp6.rapid-commit;
|
||||||
|
|
||||||
|
# name-servers and domain-search are requested by default.
|
||||||
|
# here is the way to request sip-servers-addresses too
|
||||||
|
also request dhcp6.sip-servers-addresses;
|
||||||
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:75faa831bcd8594c621ab48aacf0ae55f676facf205d7e0059f2a0216ac0030a
|
|
||||||
size 626100
|
|
@ -1,81 +0,0 @@
|
|||||||
--- client/dhclient.conf
|
|
||||||
+++ client/dhclient.conf 2008/11/11 09:12:22
|
|
||||||
@@ -1,36 +1,48 @@
|
|
||||||
-send host-name "andare.fugue.com";
|
|
||||||
-send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
|
|
||||||
+#
|
|
||||||
+# /etc/dhclient.conf -- dhclient configuration file
|
|
||||||
+# see "man dhclient.conf" for further details
|
|
||||||
+#
|
|
||||||
+
|
|
||||||
+######################################################
|
|
||||||
+# Sometimes, a special configuration is required for
|
|
||||||
+# e.g. Cable Modem providers (@Home -- TCI).
|
|
||||||
+# For example, it may be required to send out a special
|
|
||||||
+# dhcp-client-identifier or to override some settings.
|
|
||||||
+#
|
|
||||||
+# Uncomment and fill in the appropriate settings:
|
|
||||||
+#
|
|
||||||
+#send dhcp-client-identifier "c32423-a"
|
|
||||||
+# or as hex octets
|
|
||||||
+#send dhcp-client-identifier 1:0:a0:24:ab:fb:9c;
|
|
||||||
+#
|
|
||||||
+#send host-name "andare.fugue.com";
|
|
||||||
+#
|
|
||||||
+#supersede domain-name "fugue.com home.vix.com";
|
|
||||||
+#prepend domain-name-servers 127.0.0.1;
|
|
||||||
+#
|
|
||||||
+#####################################################
|
|
||||||
+
|
|
||||||
send dhcp-lease-time 3600;
|
|
||||||
-supersede domain-name "fugue.com home.vix.com";
|
|
||||||
-prepend domain-name-servers 127.0.0.1;
|
|
||||||
-request subnet-mask, broadcast-address, time-offset, routers,
|
|
||||||
- domain-name, domain-name-servers, host-name;
|
|
||||||
-require subnet-mask, domain-name-servers;
|
|
||||||
+
|
|
||||||
+# Request several well known/usefull dhcp options.
|
|
||||||
+request subnet-mask, broadcast-address, routers,
|
|
||||||
+ interface-mtu, host-name, domain-name,
|
|
||||||
+ domain-name-servers, nis-domain, nis-servers,
|
|
||||||
+ nds-context, nds-servers, nds-tree-name,
|
|
||||||
+ netbios-name-servers, netbios-dd-server,
|
|
||||||
+ netbios-node-type, netbios-scope, ntp-servers;
|
|
||||||
+
|
|
||||||
+# We request above options, require only the IP configuration:
|
|
||||||
+require subnet-mask;
|
|
||||||
+# All another options (DNS, NTP, NIS, ...) are applied using
|
|
||||||
+# netconfig(8) modules.
|
|
||||||
+
|
|
||||||
+# To enforce the availability of the dns server list, set to:
|
|
||||||
+#require subnet-mask, domain-name-servers;
|
|
||||||
+
|
|
||||||
timeout 60;
|
|
||||||
retry 60;
|
|
||||||
reboot 10;
|
|
||||||
select-timeout 5;
|
|
||||||
initial-interval 2;
|
|
||||||
-script "/etc/dhclient-script";
|
|
||||||
-media "-link0 -link1 -link2", "link0 link1";
|
|
||||||
-reject 192.33.137.209;
|
|
||||||
-
|
|
||||||
-alias {
|
|
||||||
- interface "ep0";
|
|
||||||
- fixed-address 192.5.5.213;
|
|
||||||
- option subnet-mask 255.255.255.255;
|
|
||||||
-}
|
|
||||||
-
|
|
||||||
-lease {
|
|
||||||
- interface "ep0";
|
|
||||||
- fixed-address 192.33.137.200;
|
|
||||||
- medium "link0 link1";
|
|
||||||
- option host-name "andare.swiftmedia.com";
|
|
||||||
- option subnet-mask 255.255.255.0;
|
|
||||||
- option broadcast-address 192.33.137.255;
|
|
||||||
- option routers 192.33.137.250;
|
|
||||||
- option domain-name-servers 127.0.0.1;
|
|
||||||
- renew 2 2000/1/12 00:00:01;
|
|
||||||
- rebind 2 2000/1/12 00:00:01;
|
|
||||||
- expire 2 2000/1/12 00:00:01;
|
|
||||||
-}
|
|
||||||
+
|
|
@ -1,17 +0,0 @@
|
|||||||
--- client/dhclient.c
|
|
||||||
+++ client/dhclient.c 2008/09/08 15:31:00
|
|
||||||
@@ -355,6 +355,14 @@ int main (argc, argv, envp)
|
|
||||||
/* Parse the dhclient.conf file. */
|
|
||||||
read_client_conf ();
|
|
||||||
|
|
||||||
+ /*
|
|
||||||
+ ** Override the script name definition in the config file
|
|
||||||
+ ** with the one provided as command line argument...:
|
|
||||||
+ */
|
|
||||||
+ if(no_dhclient_script) {
|
|
||||||
+ top_level_config.script_name = path_dhclient_script;
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
/* If the user specified a hostname, send it here and now */
|
|
||||||
if ((dhclient_hostname != NULL) && (*dhclient_hostname != '\0') ) {
|
|
||||||
struct parse *cfile = NULL;
|
|
@ -1,26 +0,0 @@
|
|||||||
--- dhcpctl/dhcpctl.3
|
|
||||||
+++ dhcpctl/dhcpctl.3 2008/09/08 10:02:38
|
|
||||||
@@ -425,8 +425,8 @@ that most error checking has been ommitt
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
|
|
||||||
-#include <isc/result.h>
|
|
||||||
-#include <dhcpctl/dhcpctl.h>
|
|
||||||
+#include <isc-dhcp/result.h>
|
|
||||||
+#include <dhcpctl.h>
|
|
||||||
|
|
||||||
int main (int argc, char **argv) {
|
|
||||||
dhcpctl_data_string ipaddrstring = NULL;
|
|
||||||
--- omapip/omapi.3
|
|
||||||
+++ omapip/omapi.3 2008/09/08 10:02:38
|
|
||||||
@@ -87,8 +87,8 @@ the lease ends.
|
|
||||||
#include <stdio.h>
|
|
||||||
#include <netinet/in.h>
|
|
||||||
|
|
||||||
- #include <isc/result.h>
|
|
||||||
- #include <dhcpctl/dhcpctl.h>
|
|
||||||
+ #include <isc-dhcp/result.h>
|
|
||||||
+ #include <dhcpctl.h>
|
|
||||||
|
|
||||||
int main (int argc, char **argv) {
|
|
||||||
dhcpctl_data_string ipaddrstring = NULL;
|
|
@ -1,10 +0,0 @@
|
|||||||
--- omapip/test.c
|
|
||||||
+++ omapip/test.c 2008/09/05 08:24:16
|
|
||||||
@@ -40,6 +40,7 @@
|
|
||||||
#include <isc-dhcp/result.h>
|
|
||||||
#include <sys/time.h>
|
|
||||||
#include <omapip/omapip.h>
|
|
||||||
+#include <string.h>
|
|
||||||
|
|
||||||
int main (int argc, char **argv)
|
|
||||||
{
|
|
@ -1,170 +0,0 @@
|
|||||||
--- server/dhcpd.c
|
|
||||||
+++ server/dhcpd.c 2008/09/05 08:22:38
|
|
||||||
@@ -47,6 +47,15 @@ static char url [] = "For info, please v
|
|
||||||
#include "version.h"
|
|
||||||
#include <omapip/omapip_p.h>
|
|
||||||
|
|
||||||
+#ifdef PARANOIA
|
|
||||||
+# include <errno.h>
|
|
||||||
+# include <pwd.h>
|
|
||||||
+/* get around the ISC's declaration of group */
|
|
||||||
+#define group real_group
|
|
||||||
+# include <grp.h>
|
|
||||||
+#undef group
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
static void usage PROTO ((void));
|
|
||||||
|
|
||||||
struct iaddr server_identifier;
|
|
||||||
@@ -225,6 +234,15 @@ int main (argc, argv, envp)
|
|
||||||
char *traceinfile = (char *)0;
|
|
||||||
char *traceoutfile = (char *)0;
|
|
||||||
#endif
|
|
||||||
+#ifdef PARANOIA
|
|
||||||
+ char *set_user = NULL;
|
|
||||||
+ char *set_group = NULL;
|
|
||||||
+ char *set_chroot = NULL;
|
|
||||||
+
|
|
||||||
+ uid_t set_uid = 0;
|
|
||||||
+ gid_t set_gid = 0;
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
|
|
||||||
/* Make sure that file descriptors 0 (stdin), 1, (stdout), and
|
|
||||||
2 (stderr) are open. To do this, we assume that when we
|
|
||||||
@@ -286,6 +304,20 @@ int main (argc, argv, envp)
|
|
||||||
daemon = 0;
|
|
||||||
#endif
|
|
||||||
log_perror = -1;
|
|
||||||
+#ifdef PARANOIA
|
|
||||||
+ } else if (!strcmp (argv [i], "-user")) {
|
|
||||||
+ if (++i == argc)
|
|
||||||
+ usage ();
|
|
||||||
+ set_user = argv [i];
|
|
||||||
+ } else if (!strcmp (argv [i], "-group")) {
|
|
||||||
+ if (++i == argc)
|
|
||||||
+ usage ();
|
|
||||||
+ set_group = argv [i];
|
|
||||||
+ } else if (!strcmp (argv [i], "-chroot")) {
|
|
||||||
+ if (++i == argc)
|
|
||||||
+ usage ();
|
|
||||||
+ set_chroot = argv [i];
|
|
||||||
+#endif
|
|
||||||
} else if (!strcmp (argv [i], "-s")) {
|
|
||||||
if (++i == argc)
|
|
||||||
usage ();
|
|
||||||
@@ -347,7 +379,7 @@ int main (argc, argv, envp)
|
|
||||||
log_fatal ("Insufficient memory to %s %s: %s",
|
|
||||||
"record interface", argv [i],
|
|
||||||
isc_result_totext (result));
|
|
||||||
- strcpy (tmp -> name, argv [i]);
|
|
||||||
+ strncpy (tmp -> name, argv [i], sizeof(tmp->name)-1);
|
|
||||||
if (interfaces) {
|
|
||||||
interface_reference (&tmp -> next,
|
|
||||||
interfaces, MDL);
|
|
||||||
@@ -412,6 +444,66 @@ int main (argc, argv, envp)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
+#ifdef PARANOIA
|
|
||||||
+ /* get user and group info if those options were given */
|
|
||||||
+ if (set_user) {
|
|
||||||
+ struct passwd *tmp_pwd;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ ** I query for the real UID and not for the effective UID
|
|
||||||
+ ** just to force the user to run this server as root and
|
|
||||||
+ ** not setting it suid. It should be a paranoia patch and
|
|
||||||
+ ** not a teletubbie patch. *eg*
|
|
||||||
+ ** Note: That the user is still able to set it suid! *zitter*
|
|
||||||
+ ** thomas@suse.de
|
|
||||||
+ */
|
|
||||||
+ if (getuid())
|
|
||||||
+ error ("you must be root to set user");
|
|
||||||
+
|
|
||||||
+ if (!(tmp_pwd = getpwnam(set_user)))
|
|
||||||
+ error ("no such user: %s", set_user);
|
|
||||||
+
|
|
||||||
+ set_uid = tmp_pwd->pw_uid;
|
|
||||||
+
|
|
||||||
+ /* use the user's group as the default gid */
|
|
||||||
+ if (!set_group)
|
|
||||||
+ set_gid = tmp_pwd->pw_gid;
|
|
||||||
+
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (set_group) {
|
|
||||||
+/* get around the ISC's declaration of group */
|
|
||||||
+#define group real_group
|
|
||||||
+ struct group *tmp_grp;
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ ** getuid() instead of geteuid(), see above
|
|
||||||
+ */
|
|
||||||
+ if (getuid())
|
|
||||||
+ error ("you must be root to set group");
|
|
||||||
+
|
|
||||||
+ if (!(tmp_grp = getgrnam(set_group)))
|
|
||||||
+ error ("no such group: %s", set_group);
|
|
||||||
+
|
|
||||||
+ set_gid = tmp_grp->gr_gid;
|
|
||||||
+#undef group
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (set_chroot) {
|
|
||||||
+ if (getuid()) /* see above */
|
|
||||||
+ error ("you must be root to use chroot");
|
|
||||||
+
|
|
||||||
+ if (chroot(set_chroot) != 0) {
|
|
||||||
+ error ("chroot(\"%s\"): %s", set_chroot,
|
|
||||||
+ strerror(errno));
|
|
||||||
+ }
|
|
||||||
+ if (chdir ("/") != 0) {
|
|
||||||
+ /* probably permission denied */
|
|
||||||
+ error ("chdir(\"/\"): %s", strerror(errno));
|
|
||||||
+ }
|
|
||||||
+ }
|
|
||||||
+#endif /* PARANOIA */
|
|
||||||
+
|
|
||||||
remote_port = htons (ntohs (local_port) + 1);
|
|
||||||
|
|
||||||
if (server) {
|
|
||||||
@@ -601,6 +693,27 @@ int main (argc, argv, envp)
|
|
||||||
omapi_set_int_value ((omapi_object_t *)dhcp_control_object,
|
|
||||||
(omapi_object_t *)0, "state", server_running);
|
|
||||||
|
|
||||||
+#ifdef PARANOIA
|
|
||||||
+ /* change uid to the specified one */
|
|
||||||
+
|
|
||||||
+ /*
|
|
||||||
+ ** common failure: forget to drop supplementary GID'S ;->
|
|
||||||
+ ** thomas@suse.de
|
|
||||||
+ */
|
|
||||||
+
|
|
||||||
+ if (set_gid) {
|
|
||||||
+ if(setgroups(0, NULL) < 0)
|
|
||||||
+ error("couldn't drop supplementary groups!");
|
|
||||||
+ if (setgid (set_gid) != 0)
|
|
||||||
+ error ("couldn't set gid to %d", set_gid);
|
|
||||||
+ }
|
|
||||||
+
|
|
||||||
+ if (set_uid) {
|
|
||||||
+ if (setuid (set_uid) != 0)
|
|
||||||
+ error ("couldn't set uid to %d", set_uid);
|
|
||||||
+ }
|
|
||||||
+#endif
|
|
||||||
+
|
|
||||||
/* Receive packets and dispatch them... */
|
|
||||||
dispatch ();
|
|
||||||
|
|
||||||
@@ -879,6 +992,10 @@ static void usage ()
|
|
||||||
|
|
||||||
log_fatal ("Usage: dhcpd [-p <UDP port #>] [-d] [-f]%s%s%s%s",
|
|
||||||
"\n [-cf config-file] [-lf lease-file]",
|
|
||||||
+#ifdef PARANOIA
|
|
||||||
+ "\n [-user <user>] [-group <group>]",
|
|
||||||
+ "\n [-chroot <dir>]",
|
|
||||||
+#endif
|
|
||||||
#if defined (TRACING)
|
|
||||||
"\n [-tf trace-output-file]",
|
|
||||||
"\n [-play trace-input-file]",
|
|
@ -1,148 +0,0 @@
|
|||||||
--- includes/cf/linux.h
|
|
||||||
+++ includes/cf/linux.h 2008/09/08 09:56:54
|
|
||||||
@@ -75,7 +75,7 @@ extern int h_errno;
|
|
||||||
|
|
||||||
#include <sys/time.h> /* gettimeofday()*/
|
|
||||||
|
|
||||||
-/* Databases go in /var/state/dhcp. It would also be valid to put them
|
|
||||||
+/* Databases go in /var/lib/dhcp. It would also be valid to put them
|
|
||||||
in /var/state/misc - indeed, given that there's only one lease file, it
|
|
||||||
would probably be better. However, I have some ideas for optimizing
|
|
||||||
the lease database that may result in a _lot_ of smaller files being
|
|
||||||
@@ -83,11 +83,11 @@ extern int h_errno;
|
|
||||||
directory. */
|
|
||||||
|
|
||||||
#ifndef _PATH_DHCPD_DB
|
|
||||||
-#define _PATH_DHCPD_DB "/var/state/dhcp/dhcpd.leases"
|
|
||||||
+#define _PATH_DHCPD_DB "/var/lib/dhcp/db/dhcpd.leases"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_DHCLIENT_DB
|
|
||||||
-#define _PATH_DHCLIENT_DB "/var/state/dhcp/dhclient.leases"
|
|
||||||
+#define _PATH_DHCLIENT_DB "/var/lib/dhcp/dhclient.leases"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Varargs stuff... */
|
|
||||||
--- includes/dhcpd.h
|
|
||||||
+++ includes/dhcpd.h 2008/09/08 09:56:54
|
|
||||||
@@ -1062,7 +1062,7 @@ typedef unsigned char option_mask [16];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_DHCPD_DB
|
|
||||||
-#define _PATH_DHCPD_DB "/etc/dhcpd.leases"
|
|
||||||
+#define _PATH_DHCPD_DB "/var/lib/dhcp/db/dhcpd.leases"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_DHCPD_PID
|
|
||||||
@@ -1083,7 +1083,7 @@ typedef unsigned char option_mask [16];
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_DHCLIENT_DB
|
|
||||||
-#define _PATH_DHCLIENT_DB "/etc/dhclient.leases"
|
|
||||||
+#define _PATH_DHCLIENT_DB "/var/run/dhclient.leases"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef _PATH_RESOLV_CONF
|
|
||||||
--- Makefile.conf
|
|
||||||
+++ Makefile.conf 2008/09/08 09:56:58
|
|
||||||
@@ -42,8 +42,10 @@ CATMANPAGES =
|
|
||||||
ETC = /etc
|
|
||||||
VARRUN = /var/run
|
|
||||||
VARDB = /var/db
|
|
||||||
-LIBDIR=/usr/local/lib
|
|
||||||
-INCDIR=/usr/local/include
|
|
||||||
+ifeq (${LIBDIR},)
|
|
||||||
+LIBDIR=/usr/lib
|
|
||||||
+endif
|
|
||||||
+INCDIR=/usr/include
|
|
||||||
LIBS =
|
|
||||||
COPTS = $(BINDDEF) $(CC_OPTIONS)
|
|
||||||
DEBUG = -g
|
|
||||||
@@ -277,17 +279,17 @@ MINORVERSION=MinorVersion
|
|
||||||
#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) \
|
|
||||||
# $(BINDDEF) $(CC_OPTIONS)
|
|
||||||
#CF = cf/linux.h
|
|
||||||
-#ADMMANDIR = /usr/man/man8
|
|
||||||
+#ADMMANDIR = /usr/share/man/man8
|
|
||||||
#ADMMANEXT = .8
|
|
||||||
-#FFMANDIR = /usr/man/man5
|
|
||||||
+#FFMANDIR = /usr/share/man/man5
|
|
||||||
#FFMANEXT = .5
|
|
||||||
-#LIBMANDIR = /usr/man/man3
|
|
||||||
+#LIBMANDIR = /usr/share/man/man3
|
|
||||||
#LIBMANEXT = .3
|
|
||||||
-#USRMANDIR = /usr/man/man1
|
|
||||||
+#USRMANDIR = /usr/share/man/man1
|
|
||||||
#USRMANEXT = .1
|
|
||||||
#MANCAT = man
|
|
||||||
#VARRUN = /var/run
|
|
||||||
-#VARDB = /var/state/dhcp
|
|
||||||
+#VARDB = /var/lib/dhcp
|
|
||||||
#SCRIPT=linux
|
|
||||||
##--linux-2.0--
|
|
||||||
|
|
||||||
@@ -296,17 +298,17 @@ MINORVERSION=MinorVersion
|
|
||||||
#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) \
|
|
||||||
# $(BINDDEF) $(CC_OPTIONS)
|
|
||||||
#CF = cf/linux.h
|
|
||||||
-#ADMMANDIR = /usr/man/man8
|
|
||||||
+#ADMMANDIR = /usr/share/man/man8
|
|
||||||
#ADMMANEXT = .8
|
|
||||||
-#FFMANDIR = /usr/man/man5
|
|
||||||
+#FFMANDIR = /usr/share/man/man5
|
|
||||||
#FFMANEXT = .5
|
|
||||||
-#LIBMANDIR = /usr/man/man3
|
|
||||||
+#LIBMANDIR = /usr/share/man/man3
|
|
||||||
#LIBMANEXT = .3
|
|
||||||
-#USRMANDIR = /usr/man/man1
|
|
||||||
+#USRMANDIR = /usr/share/man/man1
|
|
||||||
#USRMANEXT = .1
|
|
||||||
#MANCAT = man
|
|
||||||
#VARRUN = /var/run
|
|
||||||
-#VARDB = /var/state/dhcp
|
|
||||||
+#VARDB = /var/lib/dhcp
|
|
||||||
#SCRIPT=linux
|
|
||||||
##--linux-2.1--
|
|
||||||
|
|
||||||
@@ -315,20 +317,36 @@ MINORVERSION=MinorVersion
|
|
||||||
#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) \
|
|
||||||
# $(BINDDEF) $(CC_OPTIONS)
|
|
||||||
#CF = cf/linux.h
|
|
||||||
-#ADMMANDIR = /usr/man/man8
|
|
||||||
+#ADMMANDIR = /usr/share/man/man8
|
|
||||||
#ADMMANEXT = .8
|
|
||||||
-#FFMANDIR = /usr/man/man5
|
|
||||||
+#FFMANDIR = /usr/share/man/man5
|
|
||||||
#FFMANEXT = .5
|
|
||||||
-#LIBMANDIR = /usr/man/man3
|
|
||||||
+#LIBMANDIR = /usr/share/man/man3
|
|
||||||
#LIBMANEXT = .3
|
|
||||||
-#USRMANDIR = /usr/man/man1
|
|
||||||
+#USRMANDIR = /usr/share/man/man1
|
|
||||||
#USRMANEXT = .1
|
|
||||||
#MANCAT = man
|
|
||||||
#VARRUN = /var/run
|
|
||||||
-#VARDB = /var/state/dhcp
|
|
||||||
+#VARDB = /var/lib/dhcp
|
|
||||||
#SCRIPT=linux
|
|
||||||
##--linux-2.2--
|
|
||||||
|
|
||||||
+## Linux 2.4
|
|
||||||
+##--linux-2.4--
|
|
||||||
+#COPTS = -DLINUX_MAJOR=$(MAJORVERSION) -DLINUX_MINOR=$(MINORVERSION) $(BINDDEF)
|
|
||||||
+#CF = cf/linux.h
|
|
||||||
+#ADMMANDIR = /usr/share/man/man8
|
|
||||||
+#ADMMANEXT = .8
|
|
||||||
+#FFMANDIR = /usr/share/man/man5
|
|
||||||
+#FFMANEXT = .5
|
|
||||||
+#LIBMANDIR = /usr/share/man/man3
|
|
||||||
+#LIBMANEXT = .3
|
|
||||||
+#MANCAT = man
|
|
||||||
+#VARRUN = /var/run
|
|
||||||
+#VARDB = /var/lib/dhcp
|
|
||||||
+#SCRIPT=linux
|
|
||||||
+##--linux-2.4--
|
|
||||||
+
|
|
||||||
## SCO UnixWare 7
|
|
||||||
##--uw7--
|
|
||||||
#CF = cf/uw7.h
|
|
@ -1,45 +0,0 @@
|
|||||||
--- client/Makefile.dist
|
|
||||||
+++ client/Makefile.dist
|
|
||||||
@@ -128,6 +128,6 @@
|
|
||||||
|
|
||||||
|
|
||||||
dhclient: $(OBJS) $(DHCPLIB)
|
|
||||||
- $(CC) $(LFLAGS) -o $(PROG) $(OBJS) $(DHCPLIB) $(LIBS)
|
|
||||||
+ $(CC) $(LFLAGS) -pie -o $(PROG) $(OBJS) $(DHCPLIB) $(LIBS)
|
|
||||||
|
|
||||||
# Dependencies (semi-automatically-generated)
|
|
||||||
--- dhcpctl/Makefile.dist
|
|
||||||
+++ dhcpctl/Makefile.dist
|
|
||||||
@@ -37,10 +37,10 @@
|
|
||||||
all: libdhcpctl.a omshell cltest $(CATMANPAGES)
|
|
||||||
|
|
||||||
omshell: omshell.o $(DHCPCTLLIBS)
|
|
||||||
- $(CC) $(DEBUG) $(LFLAGS) -o omshell omshell.o $(DHCPCTLLIBS) $(LIBS)
|
|
||||||
+ $(CC) $(DEBUG) $(LFLAGS) -pie -o omshell omshell.o $(DHCPCTLLIBS) $(LIBS)
|
|
||||||
|
|
||||||
cltest: cltest.o $(DHCPCTLLIBS)
|
|
||||||
- $(CC) $(DEBUG) $(LFLAGS) -o cltest cltest.o $(DHCPCTLLIBS) $(LIBS)
|
|
||||||
+ $(CC) $(DEBUG) $(LFLAGS) -pie -o cltest cltest.o $(DHCPCTLLIBS) $(LIBS)
|
|
||||||
|
|
||||||
libdhcpctl.a: $(OBJ)
|
|
||||||
rm -f libdhcpctl.a
|
|
||||||
--- relay/Makefile.dist
|
|
||||||
+++ relay/Makefile.dist
|
|
||||||
@@ -83,6 +83,6 @@
|
|
||||||
-e "s#RUNDIR#$(VARRUN)#" < dhcrelay.8 >dhcrelay.man8
|
|
||||||
|
|
||||||
dhcrelay: dhcrelay.o $(DHCPLIB)
|
|
||||||
- $(CC) $(LFLAGS) -o $(PROG) dhcrelay.o $(DHCPLIB) $(LIBS)
|
|
||||||
+ $(CC) $(LFLAGS) -pie -o $(PROG) dhcrelay.o $(DHCPLIB) $(LIBS)
|
|
||||||
|
|
||||||
# Dependencies (semi-automatically-generated)
|
|
||||||
--- server/Makefile.dist
|
|
||||||
+++ server/Makefile.dist
|
|
||||||
@@ -103,6 +103,6 @@
|
|
||||||
-e "s#RUNDIR#$(VARRUN)#g" < dhcpd.leases.5 >dhcpd.leases.man5
|
|
||||||
|
|
||||||
dhcpd: $(OBJS) $(COBJ) $(DHCPLIB)
|
|
||||||
- $(CC) $(LFLAGS) -o dhcpd $(OBJS) $(DHCPLIB) $(LIBS)
|
|
||||||
+ $(CC) $(LFLAGS) -pie -o dhcpd $(OBJS) $(DHCPLIB) $(LIBS)
|
|
||||||
|
|
||||||
# Dependencies (semi-automatically-generated)
|
|
@ -1,13 +0,0 @@
|
|||||||
--- client/dhclient.conf
|
|
||||||
+++ client/dhclient.conf 2009/12/14 21:31:00
|
|
||||||
@@ -22,7 +22,9 @@
|
|
||||||
#
|
|
||||||
#####################################################
|
|
||||||
|
|
||||||
-send dhcp-lease-time 3600;
|
|
||||||
+# uncomment to request a specific lease time, otherwise
|
|
||||||
+# the dhcp server will provide its default lease time:
|
|
||||||
+#send dhcp-lease-time 3600;
|
|
||||||
|
|
||||||
# Request several well known/usefull dhcp options.
|
|
||||||
request subnet-mask, broadcast-address, routers,
|
|
@ -1,73 +0,0 @@
|
|||||||
--- client/scripts/linux
|
|
||||||
+++ client/scripts/linux 2009/12/14 22:29:11
|
|
||||||
@@ -28,7 +28,11 @@
|
|
||||||
# logs entire run of dhclient-script to /var/log/dhclient-script,
|
|
||||||
# if DHCLIENT_DEBUG is set in sysconfig/network/dhcp
|
|
||||||
#
|
|
||||||
-eval `grep "^DHCLIENT_DEBUG=" /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
||||||
+SYSCONFIG_CFG_DIR="/etc/sysconfig/network"
|
|
||||||
+SYSCONFIG_RUN_DIR=`. "$SYSCONFIG_CFG_DIR/scripts/functions" \
|
|
||||||
+ 2>/dev/null && echo "$RUN_FILES_BASE"`
|
|
||||||
+SYSCONFIG_RUN_DIR=${SYSCONFIG_RUN_DIR:-/dev/.sysconfig/network}
|
|
||||||
+eval `grep "^DHCLIENT_DEBUG=" "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
|
|
||||||
if [ "$DHCLIENT_DEBUG" = yes ]; then
|
|
||||||
set -a # allexport
|
|
||||||
(
|
|
||||||
@@ -90,21 +94,21 @@ netconfig_remove() {
|
|
||||||
}
|
|
||||||
set_default_gw_route()
|
|
||||||
{
|
|
||||||
- if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
|
|
||||||
- -f /dev/shm/sysconfig/if-${interface} ;
|
|
||||||
+ if test -f "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" -o \
|
|
||||||
+ -f "$SYSCONFIG_RUN_DIR/if-${interface}" ;
|
|
||||||
then
|
|
||||||
- if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
|
|
||||||
+ if grep -qs '^primary=yes' "$SYSCONFIG_RUN_DIR/if-${interface}" 2>/dev/null ;
|
|
||||||
then
|
|
||||||
eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
||||||
- /etc/sysconfig/network/dhcp
|
|
||||||
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/dhcp"
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
|
||||||
else
|
|
||||||
eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
||||||
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
||||||
- /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
|
|
||||||
fi
|
|
||||||
if [ "$DHCLIENT_SET_DEFAULT_ROUTE" = yes ] ; then
|
|
||||||
for router in $new_routers; do
|
|
||||||
@@ -130,21 +134,21 @@ set_default_gw_route()
|
|
||||||
}
|
|
||||||
set_hostname()
|
|
||||||
{
|
|
||||||
- if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
|
|
||||||
- -f /dev/shm/sysconfig/if-${interface} ;
|
|
||||||
+ if test -f "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" -o \
|
|
||||||
+ -f "$SYSCONFIG_RUN_DIR/if-${interface}" ;
|
|
||||||
then
|
|
||||||
- if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
|
|
||||||
+ if grep -qs '^primary=yes' "$SYSCONFIG_RUN_DIR/if-${interface}" 2>/dev/null ;
|
|
||||||
then
|
|
||||||
eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
||||||
- /etc/sysconfig/network/dhcp
|
|
||||||
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/dhcp"
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
|
||||||
else
|
|
||||||
eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
||||||
- /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" 2>/dev/null`
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
||||||
- /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
||||||
+ "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
|
|
||||||
fi
|
|
||||||
if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then
|
|
||||||
current_hostname=`hostname`
|
|
@ -1,156 +0,0 @@
|
|||||||
--- client/scripts/linux
|
|
||||||
+++ client/scripts/linux 2010/03/04 13:30:09
|
|
||||||
@@ -29,8 +29,7 @@
|
|
||||||
# if DHCLIENT_DEBUG is set in sysconfig/network/dhcp
|
|
||||||
#
|
|
||||||
SYSCONFIG_CFG_DIR="/etc/sysconfig/network"
|
|
||||||
-SYSCONFIG_RUN_DIR=`. "$SYSCONFIG_CFG_DIR/scripts/functions" \
|
|
||||||
- 2>/dev/null && echo "$RUN_FILES_BASE"`
|
|
||||||
+. "$SYSCONFIG_CFG_DIR/scripts/functions"
|
|
||||||
SYSCONFIG_RUN_DIR=${SYSCONFIG_RUN_DIR:-/dev/.sysconfig/network}
|
|
||||||
eval `grep "^DHCLIENT_DEBUG=" "$SYSCONFIG_CFG_DIR/dhcp" 2>/dev/null`
|
|
||||||
if [ "$DHCLIENT_DEBUG" = yes ]; then
|
|
||||||
@@ -40,7 +39,7 @@ if [ "$DHCLIENT_DEBUG" = yes ]; then
|
|
||||||
echo "$0 $*"
|
|
||||||
date
|
|
||||||
echo '----------------'
|
|
||||||
- set
|
|
||||||
+ env
|
|
||||||
echo '----------------'
|
|
||||||
) >> /var/log/dhclient-script.log
|
|
||||||
exec 2>> /var/log/dhclient-script.log
|
|
||||||
@@ -48,6 +47,10 @@ if [ "$DHCLIENT_DEBUG" = yes ]; then
|
|
||||||
set -x
|
|
||||||
fi
|
|
||||||
|
|
||||||
+is_ifup_controlled()
|
|
||||||
+{
|
|
||||||
+ test -f "$SYSCONFIG_RUN_DIR/if-${interface}"
|
|
||||||
+}
|
|
||||||
# netconfig makes all "additional" modifications as DNS or NTP
|
|
||||||
use_netconfig() {
|
|
||||||
test -x /sbin/netconfig
|
|
||||||
@@ -94,9 +97,7 @@ netconfig_remove() {
|
|
||||||
}
|
|
||||||
set_default_gw_route()
|
|
||||||
{
|
|
||||||
- if test -f "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" -o \
|
|
||||||
- -f "$SYSCONFIG_RUN_DIR/if-${interface}" ;
|
|
||||||
- then
|
|
||||||
+ if is_ifup_controlled ; then
|
|
||||||
if grep -qs '^primary=yes' "$SYSCONFIG_RUN_DIR/if-${interface}" 2>/dev/null ;
|
|
||||||
then
|
|
||||||
eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
||||||
@@ -134,9 +135,7 @@ set_default_gw_route()
|
|
||||||
}
|
|
||||||
set_hostname()
|
|
||||||
{
|
|
||||||
- if test -f "$SYSCONFIG_CFG_DIR/ifcfg-${interface}" -o \
|
|
||||||
- -f "$SYSCONFIG_RUN_DIR/if-${interface}" ;
|
|
||||||
- then
|
|
||||||
+ if is_ifup_controlled ; then
|
|
||||||
if grep -qs '^primary=yes' "$SYSCONFIG_RUN_DIR/if-${interface}" 2>/dev/null ;
|
|
||||||
then
|
|
||||||
eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
||||||
@@ -157,13 +156,14 @@ set_hostname()
|
|
||||||
[ "x${current_hostname%%.*}" = "xlocalhost" ] || \
|
|
||||||
[ "x${current_hostname%%.*}" != "x${new_host_name%%.*}" ]; then
|
|
||||||
|
|
||||||
- if [ "x${new_host_name%%.*}" != x ]; then
|
|
||||||
+ if [ "x${new_host_name%%.*}" != "x" ]; then
|
|
||||||
hostname "${new_host_name%%.*}"
|
|
||||||
else
|
|
||||||
if [ -x /usr/bin/host ] ; then
|
|
||||||
if out=`host -W 2 "$new_ip_address" 2>/dev/null` ; then
|
|
||||||
_hostname="`echo "$out" | sed 's:^.* ::; s:\..*::'`"
|
|
||||||
- if [ "x${_hostname}" != x ]; then
|
|
||||||
+ if [ "x${_hostname}" != "x" -a \
|
|
||||||
+ "x${_hostname}" != "x${current_hostname%%.*}" ]; then
|
|
||||||
hostname "${_hostname}"
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
@@ -171,6 +171,20 @@ set_hostname()
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
+ if is_ifup_controlled ; then
|
|
||||||
+ # check regardless the DHCLIENT_SET_HOSTNAME setting
|
|
||||||
+ # and whether we've set it above or not, because when
|
|
||||||
+ # it changed, we've to handle it anyway...
|
|
||||||
+ local OLD_HOSTNAME=`read_cached_config_data hostname $interface`
|
|
||||||
+ local CUR_HOSTNAME=`hostname 2>/dev/null`
|
|
||||||
+ if test "x$OLD_HOSTNAME" != "x$CUR_HOSTNAME" ; then
|
|
||||||
+ write_cached_config_data hostname "$CUR_HOSTNAME" $interface
|
|
||||||
+ commit_cached_config_data $interface
|
|
||||||
+
|
|
||||||
+ # reload syslog so it knows the new hostname
|
|
||||||
+ /etc/init.d/syslog reload
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
}
|
|
||||||
|
|
||||||
resolv_conf_dhclient="/var/lib/dhcp/resolv.conf.dhclient.$interface"
|
|
||||||
@@ -300,7 +314,15 @@ if [ x$reason = xBOUND ] || [ x$reason =
|
|
||||||
# and clear the ARP cache.
|
|
||||||
ifconfig $interface inet 0
|
|
||||||
|
|
||||||
+ if is_ifup_controlled ; then
|
|
||||||
+ write_cached_config_data dhcp4_state "new" $interface
|
|
||||||
+ commit_cached_config_data $interface
|
|
||||||
+ fi
|
|
||||||
+ elif is_ifup_controlled ; then
|
|
||||||
+ write_cached_config_data dhcp4_state "up" $interface
|
|
||||||
+ commit_cached_config_data $interface
|
|
||||||
fi
|
|
||||||
+
|
|
||||||
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
|
||||||
[ x$reason = xBOUND ] || [ x$reason = xREBOOT ]; then
|
|
||||||
|
|
||||||
@@ -328,7 +350,20 @@ if [ x$reason = xBOUND ] || [ x$reason =
|
|
||||||
make_resolv_conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
+ if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
|
|
||||||
+ if is_ifup_controlled ; then
|
|
||||||
+ ifdown $interface -o dhcp
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
set_hostname
|
|
||||||
+ if is_ifup_controlled ; then
|
|
||||||
+ # execute ifservice and if-up.d scripts
|
|
||||||
+ ifup $interface -o dhcp
|
|
||||||
+
|
|
||||||
+ write_cached_config_data dhcp4_state "complete" $interface
|
|
||||||
+ commit_cached_config_data $interface
|
|
||||||
+ fi
|
|
||||||
|
|
||||||
exit_with_hooks 0
|
|
||||||
fi
|
|
||||||
@@ -376,12 +411,26 @@ if [ x$reason = xTIMEOUT ]; then
|
|
||||||
make_resolv_conf
|
|
||||||
fi
|
|
||||||
|
|
||||||
+ set_hostname
|
|
||||||
+ if is_ifup_controlled ; then
|
|
||||||
+ # execute ifservice and if-up.d scripts
|
|
||||||
+ ifup $interface -o dhcp
|
|
||||||
+
|
|
||||||
+ write_cached_config_data dhcp4_state "complete" $interface
|
|
||||||
+ commit_cached_config_data $interface
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
exit_with_hooks 0
|
|
||||||
fi
|
|
||||||
ifconfig $interface inet 0
|
|
||||||
exit_with_hooks 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
+if is_ifup_controlled ; then
|
|
||||||
+ write_cached_config_data dhcp4_state "down" $interface
|
|
||||||
+ commit_cached_config_data $interface
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
if use_netconfig ; then
|
|
||||||
netconfig_remove
|
|
||||||
else
|
|
@ -1,383 +0,0 @@
|
|||||||
--- client/dhclient-script.8
|
|
||||||
+++ client/dhclient-script.8 2009/10/16 08:10:52
|
|
||||||
@@ -45,9 +45,10 @@ any, and also called once if no valid le
|
|
||||||
This script is not meant to be customized by the end user. If local
|
|
||||||
customizations are needed, they should be possible using the enter and
|
|
||||||
exit hooks provided (see HOOKS for details). These hooks will allow the
|
|
||||||
-user to override the default behaviour of the client in creating a
|
|
||||||
+user to override the default behaviour of the client in applying of
|
|
||||||
+additional settings like DNS (e.g. creating a
|
|
||||||
.B /etc/resolv.conf
|
|
||||||
-file.
|
|
||||||
+file), NTP or YP to the system.
|
|
||||||
.PP
|
|
||||||
No standard client script exists for some operating systems, even though
|
|
||||||
the actual client may work, so a pioneering user may well need to create
|
|
||||||
@@ -59,12 +60,43 @@ customizing
|
|
||||||
.B ETCDIR/dhclient.conf
|
|
||||||
or using the enter and exit hooks, please submit a bug report.
|
|
||||||
.SH HOOKS
|
|
||||||
-When it starts, the client script first defines a shell function,
|
|
||||||
-.B make_resolv_conf ,
|
|
||||||
-which is later used to create the
|
|
||||||
+When it starts, the client script first defines several shell functions:
|
|
||||||
+.BR use_netconfig ,
|
|
||||||
+.BR netconfig_modify ,
|
|
||||||
+.BR netconfig_remove ,
|
|
||||||
+.BR make_resolv_conf ,
|
|
||||||
+and
|
|
||||||
+.BR restore_resolv_conf .
|
|
||||||
+These functions are later used to apply DNS, NTP, YP, and other additional
|
|
||||||
+settings to the system.
|
|
||||||
+
|
|
||||||
+The
|
|
||||||
+.B use_netconfig
|
|
||||||
+returns true (0), when the /sbin/netconfig script is installed and enables
|
|
||||||
+the use of the
|
|
||||||
+.B netconfig_modify
|
|
||||||
+and
|
|
||||||
+.B netconfig_remove
|
|
||||||
+functions.
|
|
||||||
+.br
|
|
||||||
+Otherwise, the
|
|
||||||
+.BR make_resolv_conf
|
|
||||||
+and
|
|
||||||
+.BR restore_resolv_conf
|
|
||||||
+functions are used. These functions are modified to create
|
|
||||||
+/var/lib/dhcp/resolv.conf.dhclient.$interface files only
|
|
||||||
+instead of the
|
|
||||||
.B /etc/resolv.conf
|
|
||||||
-file. To override the default behaviour, redefine this function in
|
|
||||||
-the enter hook script.
|
|
||||||
+file.
|
|
||||||
+To override the default behaviour, redefine these function in the enter
|
|
||||||
+hook script. Before you start doing this, consider to implement own
|
|
||||||
+netconfig modules.
|
|
||||||
+
|
|
||||||
+.IR Note :
|
|
||||||
+Note, that since openSUSE 11.1, the modify_resolvconf script / mechanizm
|
|
||||||
+is obsoleted by netconfig and not shipped or supported any more.
|
|
||||||
+See the netconfig(8) manual page for more informations.
|
|
||||||
+
|
|
||||||
.PP
|
|
||||||
On after defining the make_resolv_conf function, the client script checks
|
|
||||||
for the presence of an executable
|
|
||||||
@@ -221,7 +253,7 @@ valid, this shouldn't cause any real pro
|
|
||||||
confusing.
|
|
||||||
.SH SEE ALSO
|
|
||||||
dhclient(8), dhcpd(8), dhcrelay(8), dhclient.conf(5) and
|
|
||||||
-dhclient.leases(5).
|
|
||||||
+dhclient.leases(5) and netconfig(8).
|
|
||||||
.SH AUTHOR
|
|
||||||
.B dhclient-script(8)
|
|
||||||
has been written for Internet Systems Consortium
|
|
||||||
--- client/scripts/linux
|
|
||||||
+++ client/scripts/linux 2009/10/16 08:16:11
|
|
||||||
@@ -22,25 +22,183 @@
|
|
||||||
# 4. TIMEOUT not tested. ping has a flag I don't know, and I'm suspicious
|
|
||||||
# of the $1 in its args.
|
|
||||||
|
|
||||||
+
|
|
||||||
+# Debugging:
|
|
||||||
+#
|
|
||||||
+# logs entire run of dhclient-script to /var/log/dhclient-script,
|
|
||||||
+# if DHCLIENT_DEBUG is set in sysconfig/network/dhcp
|
|
||||||
+#
|
|
||||||
+eval `grep "^DHCLIENT_DEBUG=" /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
||||||
+if [ "$DHCLIENT_DEBUG" = yes ]; then
|
|
||||||
+ set -a # allexport
|
|
||||||
+ (
|
|
||||||
+ echo '****************'
|
|
||||||
+ echo "$0 $*"
|
|
||||||
+ date
|
|
||||||
+ echo '----------------'
|
|
||||||
+ set
|
|
||||||
+ echo '----------------'
|
|
||||||
+ ) >> /var/log/dhclient-script.log
|
|
||||||
+ exec 2>> /var/log/dhclient-script.log
|
|
||||||
+ set +a
|
|
||||||
+ set -x
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
+# netconfig makes all "additional" modifications as DNS or NTP
|
|
||||||
+use_netconfig() {
|
|
||||||
+ test -x /sbin/netconfig
|
|
||||||
+}
|
|
||||||
+netconfig_modify() {
|
|
||||||
+ if test -x /sbin/netconfig -a -n "$interface" ; then
|
|
||||||
+ {
|
|
||||||
+ echo "INTERFACE='$interface'"
|
|
||||||
+ for v in ${!new_*}; do
|
|
||||||
+ case $v in
|
|
||||||
+ (new_ip_address) k='IPADDR' ;;
|
|
||||||
+ (new_subnet_mask) k='NETMASK' ;;
|
|
||||||
+ (new_network_number) k='NETWORK' ;;
|
|
||||||
+ (new_broadcast_address) k='BROADCAST' ;;
|
|
||||||
+ (new_interface_mtu) k='MTU' ;;
|
|
||||||
+ # (new_static_routes) k='ROUTES' ;;
|
|
||||||
+ (new_routers) k='GATEWAYS' ;;
|
|
||||||
+ (new_host_name) k='HOSTNAME' ;;
|
|
||||||
+ (new_domain_search) k='DNSSEARCH' ;;
|
|
||||||
+ (new_domain_name) k='DNSDOMAIN' ;;
|
|
||||||
+ (new_domain_name_servers) k='DNSSERVERS' ;;
|
|
||||||
+ (new_ntp_servers) k='NTPSERVERS' ;;
|
|
||||||
+ (new_nis_domain) k='NISDOMAIN' ;;
|
|
||||||
+ (new_nis_servers) k='NISSERVERS' ;;
|
|
||||||
+ (new_root_path) k='ROOTPATH' ;;
|
|
||||||
+ (new_dhcp_server_identifier)k='DHCPSID' ;;
|
|
||||||
+ (new_lpr_servers) k='LPRSERVER' ;;
|
|
||||||
+ (new_log_servers) k='LOGSERVER' ;;
|
|
||||||
+ (new_netbios_dd_server) k='NETBIOSDDSERVER' ;;
|
|
||||||
+ (new_netbios_name_servers) k='NETBIOSNAMESERVER' ;;
|
|
||||||
+ (new_netbios_node_type) k='NETBIOSNODETYPE' ;;
|
|
||||||
+ (new_netbios_scope) k='NETBIOSSCOPE' ;;
|
|
||||||
+ (*) k="dhclient_${v#new_}" ;;
|
|
||||||
+ esac
|
|
||||||
+ [ "k${k}" != k ] && echo "${k}='${!v}'"
|
|
||||||
+ done
|
|
||||||
+ } | /sbin/netconfig modify -s "dhclient3" -i "$interface"
|
|
||||||
+ fi
|
|
||||||
+}
|
|
||||||
+netconfig_remove() {
|
|
||||||
+ if test -x /sbin/netconfig -a -n "$interface" ; then
|
|
||||||
+ /sbin/netconfig remove -s "dhclient3" -i "$interface" </dev/null
|
|
||||||
+ fi
|
|
||||||
+}
|
|
||||||
+set_default_gw_route()
|
|
||||||
+{
|
|
||||||
+ if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
|
|
||||||
+ -f /dev/shm/sysconfig/if-${interface} ;
|
|
||||||
+ then
|
|
||||||
+ if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
|
|
||||||
+ then
|
|
||||||
+ eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
||||||
+ /etc/sysconfig/network/dhcp
|
|
||||||
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ else
|
|
||||||
+ eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
||||||
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ fi
|
|
||||||
+ else
|
|
||||||
+ eval `grep --no-filename '^[[:space:]]*DHCLIENT_SET_DEFAULT_ROUTE=' \
|
|
||||||
+ /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
||||||
+ fi
|
|
||||||
+ if [ "$DHCLIENT_SET_DEFAULT_ROUTE" = yes ] ; then
|
|
||||||
+ for router in $new_routers; do
|
|
||||||
+ err=`route add default gw $router $metric_arg dev $interface 2>&1` && break || \
|
|
||||||
+ case "$err" in
|
|
||||||
+ SIOCADDRT:*)
|
|
||||||
+ # The gateway seems to be not reachable via local network
|
|
||||||
+ # route (implicitely created by ifconfig based on the IP
|
|
||||||
+ # an netmask provided by dhcp).
|
|
||||||
+ # Check this, set an explicit host route to the gateway
|
|
||||||
+ # over the current interface and try again (bnc#266215).
|
|
||||||
+ matches=$(test -x /sbin/ip && \
|
|
||||||
+ /sbin/ip -f inet -o route list match $router | \
|
|
||||||
+ grep -v ^default | grep -c -v "^$" 2>/dev/null)
|
|
||||||
+ if test -n "$matches" -a $(($matches)) -eq 0 ; then
|
|
||||||
+ route add -host $router dev $interface && \
|
|
||||||
+ route add default gw $router $metric_arg dev $interface && break
|
|
||||||
+ fi
|
|
||||||
+ ;;
|
|
||||||
+ esac
|
|
||||||
+ done
|
|
||||||
+ fi
|
|
||||||
+}
|
|
||||||
+set_hostname()
|
|
||||||
+{
|
|
||||||
+ if test -f /etc/sysconfig/network/ifcfg-${interface} -o \
|
|
||||||
+ -f /dev/shm/sysconfig/if-${interface} ;
|
|
||||||
+ then
|
|
||||||
+ if grep -qs '^primary=yes' /dev/shm/sysconfig/if-${interface} 2>/dev/null ;
|
|
||||||
+ then
|
|
||||||
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
||||||
+ /etc/sysconfig/network/dhcp
|
|
||||||
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ else
|
|
||||||
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
||||||
+ /etc/sysconfig/network/ifcfg-${interface} 2>/dev/null`
|
|
||||||
+ fi
|
|
||||||
+ else
|
|
||||||
+ eval `grep --no-filename "^[[:space:]]*DHCLIENT_SET_HOSTNAME=" \
|
|
||||||
+ /etc/sysconfig/network/dhcp 2>/dev/null`
|
|
||||||
+ fi
|
|
||||||
+ if [ "$DHCLIENT_SET_HOSTNAME" = yes ] ; then
|
|
||||||
+ current_hostname=`hostname`
|
|
||||||
+ if [ "x${current_hostname%%.*}" = "x" ] || \
|
|
||||||
+ [ "x${current_hostname%%.*}" = "x(none)" ] || \
|
|
||||||
+ [ "x${current_hostname%%.*}" = "xlocalhost" ] || \
|
|
||||||
+ [ "x${current_hostname%%.*}" != "x${new_host_name%%.*}" ]; then
|
|
||||||
+
|
|
||||||
+ if [ "x${new_host_name%%.*}" != x ]; then
|
|
||||||
+ hostname "${new_host_name%%.*}"
|
|
||||||
+ else
|
|
||||||
+ if [ -x /usr/bin/host ] ; then
|
|
||||||
+ if out=`host -W 2 "$new_ip_address" 2>/dev/null` ; then
|
|
||||||
+ _hostname="`echo "$out" | sed 's:^.* ::; s:\..*::'`"
|
|
||||||
+ if [ "x${_hostname}" != x ]; then
|
|
||||||
+ hostname "${_hostname}"
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+ fi
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+resolv_conf_dhclient="/var/lib/dhcp/resolv.conf.dhclient.$interface"
|
|
||||||
make_resolv_conf() {
|
|
||||||
+ ###
|
|
||||||
+ ### note: this function is never used by default
|
|
||||||
+ ### and it has been modified to create the
|
|
||||||
+ ### /var/lib/dhcp/resolv.conf.dhclient.$interface
|
|
||||||
+ ### file instead /etc/resolv.conf.
|
|
||||||
+ ###
|
|
||||||
if [ x"$new_domain_name_servers" != x ]; then
|
|
||||||
- cat /dev/null > /etc/resolv.conf.dhclient
|
|
||||||
- chmod 644 /etc/resolv.conf.dhclient
|
|
||||||
+ cat /dev/null > "$resolv_conf_dhclient"
|
|
||||||
+ chmod 644 "$resolv_conf_dhclient"
|
|
||||||
if [ x"$new_domain_search" != x ]; then
|
|
||||||
- echo search $new_domain_search >> /etc/resolv.conf.dhclient
|
|
||||||
+ echo search $new_domain_search >> "$resolv_conf_dhclient"
|
|
||||||
elif [ x"$new_domain_name" != x ]; then
|
|
||||||
# Note that the DHCP 'Domain Name Option' is really just a domain
|
|
||||||
# name, and that this practice of using the domain name option as
|
|
||||||
# a search path is both nonstandard and deprecated.
|
|
||||||
- echo search $new_domain_name >> /etc/resolv.conf.dhclient
|
|
||||||
+ echo search $new_domain_name >> "$resolv_conf_dhclient"
|
|
||||||
fi
|
|
||||||
for nameserver in $new_domain_name_servers; do
|
|
||||||
- echo nameserver $nameserver >>/etc/resolv.conf.dhclient
|
|
||||||
+ echo nameserver $nameserver >> "$resolv_conf_dhclient"
|
|
||||||
done
|
|
||||||
|
|
||||||
- mv /etc/resolv.conf.dhclient /etc/resolv.conf
|
|
||||||
+ ### mv /etc/resolv.conf.dhclient /etc/resolv.conf
|
|
||||||
fi
|
|
||||||
}
|
|
||||||
+restore_resolv_conf()
|
|
||||||
+{
|
|
||||||
+ rm -f "$resolv_conf_dhclient"
|
|
||||||
+}
|
|
||||||
|
|
||||||
# Must be used on exit. Invokes the local dhcp client exit hooks, if any.
|
|
||||||
exit_with_hooks() {
|
|
||||||
@@ -84,7 +242,12 @@ if [ x$alias_subnet_mask != x ]; then
|
|
||||||
alias_subnet_arg="netmask $alias_subnet_mask"
|
|
||||||
fi
|
|
||||||
if [ x$new_interface_mtu != x ]; then
|
|
||||||
- mtu_arg="mtu $new_interface_mtu"
|
|
||||||
+ if [ $(( $new_interface_mtu )) -lt 576 ] ; then
|
|
||||||
+ # 68 is the minimal legal value, but 576 the real life minimum
|
|
||||||
+ unset new_interface_mtu
|
|
||||||
+ else
|
|
||||||
+ mtu_arg="mtu $new_interface_mtu"
|
|
||||||
+ fi
|
|
||||||
fi
|
|
||||||
if [ x$IF_METRIC != x ]; then
|
|
||||||
metric_arg="metric $IF_METRIC"
|
|
||||||
@@ -122,15 +285,6 @@ fi
|
|
||||||
|
|
||||||
if [ x$reason = xBOUND ] || [ x$reason = xRENEW ] || \
|
|
||||||
[ x$reason = xREBIND ] || [ x$reason = xREBOOT ]; then
|
|
||||||
- current_hostname=`hostname`
|
|
||||||
- if [ x$current_hostname = x ] || \
|
|
||||||
- [ x$current_hostname = "x(none)" ] || \
|
|
||||||
- [ x$current_hostname = xlocalhost ] || \
|
|
||||||
- [ x$current_hostname = x$old_host_name ]; then
|
|
||||||
- if [ x$new_host_name != x$old_host_name ]; then
|
|
||||||
- hostname "$new_host_name"
|
|
||||||
- fi
|
|
||||||
- fi
|
|
||||||
|
|
||||||
if [ x$old_ip_address != x ] && [ x$alias_ip_address != x ] && \
|
|
||||||
[ x$alias_ip_address != x$old_ip_address ]; then
|
|
||||||
@@ -140,7 +294,7 @@ if [ x$reason = xBOUND ] || [ x$reason =
|
|
||||||
if [ x$old_ip_address != x ] && [ x$old_ip_address != x$new_ip_address ]; then
|
|
||||||
# IP address changed. Bringing down the interface will delete all routes,
|
|
||||||
# and clear the ARP cache.
|
|
||||||
- ifconfig $interface inet 0 down
|
|
||||||
+ ifconfig $interface inet 0
|
|
||||||
|
|
||||||
fi
|
|
||||||
if [ x$old_ip_address = x ] || [ x$old_ip_address != x$new_ip_address ] || \
|
|
||||||
@@ -153,17 +307,25 @@ if [ x$reason = xBOUND ] || [ x$reason =
|
|
||||||
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
|
||||||
route add -net $new_network_number $new_subnet_arg dev $interface
|
|
||||||
fi
|
|
||||||
- for router in $new_routers; do
|
|
||||||
- route add default gw $router $metric_arg dev $interface
|
|
||||||
- done
|
|
||||||
+
|
|
||||||
+ set_default_gw_route
|
|
||||||
fi
|
|
||||||
+
|
|
||||||
if [ x$new_ip_address != x$alias_ip_address ] && [ x$alias_ip_address != x ];
|
|
||||||
then
|
|
||||||
ifconfig $interface:0- inet 0
|
|
||||||
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
||||||
route add -host $alias_ip_address $interface:0
|
|
||||||
fi
|
|
||||||
- make_resolv_conf
|
|
||||||
+
|
|
||||||
+ if use_netconfig ; then
|
|
||||||
+ netconfig_modify
|
|
||||||
+ else
|
|
||||||
+ make_resolv_conf
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
+ set_hostname
|
|
||||||
+
|
|
||||||
exit_with_hooks 0
|
|
||||||
fi
|
|
||||||
|
|
||||||
@@ -175,7 +337,7 @@ if [ x$reason = xEXPIRE ] || [ x$reason
|
|
||||||
fi
|
|
||||||
if [ x$old_ip_address != x ]; then
|
|
||||||
# Shut down interface, which will delete routes and clear arp cache.
|
|
||||||
- ifconfig $interface inet 0 down
|
|
||||||
+ ifconfig $interface inet 0
|
|
||||||
fi
|
|
||||||
if [ x$alias_ip_address != x ]; then
|
|
||||||
ifconfig $interface:0 inet $alias_ip_address $alias_subnet_arg
|
|
||||||
@@ -190,7 +352,7 @@ if [ x$reason = xTIMEOUT ]; then
|
|
||||||
fi
|
|
||||||
ifconfig $interface inet $new_ip_address $new_subnet_arg \
|
|
||||||
$new_broadcast_arg $mtu_arg
|
|
||||||
- set $new_routers
|
|
||||||
+ set -- $new_routers
|
|
||||||
if ping -q -c 1 $1; then
|
|
||||||
if [ x$new_ip_address != x$alias_ip_address ] && \
|
|
||||||
[ x$alias_ip_address != x ]; then
|
|
||||||
@@ -201,14 +363,25 @@ if [ x$reason = xTIMEOUT ]; then
|
|
||||||
( [ $relmajor -eq 2 ] && [ $relminor -eq 0 ] ); then
|
|
||||||
route add -net $new_network_number
|
|
||||||
fi
|
|
||||||
- for router in $new_routers; do
|
|
||||||
- route add default gw $router $metric_arg dev $interface
|
|
||||||
- done
|
|
||||||
- make_resolv_conf
|
|
||||||
+
|
|
||||||
+ set_default_gw_route
|
|
||||||
+
|
|
||||||
+ if use_netconfig ; then
|
|
||||||
+ netconfig_modify
|
|
||||||
+ else
|
|
||||||
+ make_resolv_conf
|
|
||||||
+ fi
|
|
||||||
+
|
|
||||||
exit_with_hooks 0
|
|
||||||
fi
|
|
||||||
- ifconfig $interface inet 0 down
|
|
||||||
+ ifconfig $interface inet 0
|
|
||||||
exit_with_hooks 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
+if use_netconfig ; then
|
|
||||||
+ netconfig_remove
|
|
||||||
+else
|
|
||||||
+ restore_resolv_conf
|
|
||||||
+fi
|
|
||||||
+
|
|
||||||
exit_with_hooks 0
|
|
@ -1,3 +0,0 @@
|
|||||||
version https://git-lfs.github.com/spec/v1
|
|
||||||
oid sha256:9d652eebb6a2d447fbc85635bb6c64211434c2dd9ec4862017d69871e5dc20f0
|
|
||||||
size 44910
|
|
32
dhcp-4.1.1-default-paths.diff
Normal file
32
dhcp-4.1.1-default-paths.diff
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
diff --git a/includes/dhcpd.h b/includes/dhcpd.h
|
||||||
|
index 90f8a73..6fa5b9e 100644
|
||||||
|
--- a/includes/dhcpd.h
|
||||||
|
+++ b/includes/dhcpd.h
|
||||||
|
@@ -1285,11 +1285,11 @@ typedef unsigned char option_mask [16];
|
||||||
|
#endif /* DEBUG */
|
||||||
|
|
||||||
|
#ifndef _PATH_DHCPD_DB
|
||||||
|
-#define _PATH_DHCPD_DB LOCALSTATEDIR"/db/dhcpd.leases"
|
||||||
|
+#define _PATH_DHCPD_DB LOCALSTATEDIR"/lib/dhcp/db/dhcpd.leases"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PATH_DHCPD6_DB
|
||||||
|
-#define _PATH_DHCPD6_DB LOCALSTATEDIR"/db/dhcpd6.leases"
|
||||||
|
+#define _PATH_DHCPD6_DB LOCALSTATEDIR"/lib/dhcp6/db/dhcpd6.leases"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PATH_DHCPD_PID
|
||||||
|
@@ -1319,11 +1319,11 @@ typedef unsigned char option_mask [16];
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PATH_DHCLIENT_DB
|
||||||
|
-#define _PATH_DHCLIENT_DB LOCALSTATEDIR"/db/dhclient.leases"
|
||||||
|
+#define _PATH_DHCLIENT_DB LOCALSTATEDIR"/lib/dhcp/dhclient.leases"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PATH_DHCLIENT6_DB
|
||||||
|
-#define _PATH_DHCLIENT6_DB LOCALSTATEDIR"/db/dhclient6.leases"
|
||||||
|
+#define _PATH_DHCLIENT6_DB LOCALSTATEDIR"/lib/dhcp6/dhclient6.leases"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef _PATH_RESOLV_CONF
|
@ -1,6 +1,8 @@
|
|||||||
--- client/dhclient.c
|
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||||
+++ client/dhclient.c 2008/09/08 09:27:16
|
index 69dcc91..15c31a5 100644
|
||||||
@@ -2659,6 +2659,12 @@ int script_go (client)
|
--- a/client/dhclient.c
|
||||||
|
+++ b/client/dhclient.c
|
||||||
|
@@ -3173,6 +3173,12 @@ int script_go (client)
|
||||||
*/
|
*/
|
||||||
if (leaseFile != NULL)
|
if (leaseFile != NULL)
|
||||||
fclose(leaseFile);
|
fclose(leaseFile);
|
17
dhcp-4.1.1-dhclient-exec-filedes.diff
Normal file
17
dhcp-4.1.1-dhclient-exec-filedes.diff
Normal file
@ -0,0 +1,17 @@
|
|||||||
|
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||||
|
index 69dcc91..15c31a5 100644
|
||||||
|
--- a/client/dhclient.c
|
||||||
|
+++ b/client/dhclient.c
|
||||||
|
@@ -3173,6 +3173,12 @@ int script_go (client)
|
||||||
|
*/
|
||||||
|
if (leaseFile != NULL)
|
||||||
|
fclose(leaseFile);
|
||||||
|
+ if ((i = open("/dev/null", O_RDWR)) != -1) {
|
||||||
|
+ dup2(i, STDIN_FILENO);
|
||||||
|
+ dup2(i, STDOUT_FILENO);
|
||||||
|
+ if (i > STDERR_FILENO)
|
||||||
|
+ close(i);
|
||||||
|
+ }
|
||||||
|
execve (scriptName, argv, envp);
|
||||||
|
log_error ("execve (%s, ...): %m", scriptName);
|
||||||
|
exit (0);
|
16
dhcp-4.1.1-dhclient-no-libcrypto.diff
Normal file
16
dhcp-4.1.1-dhclient-no-libcrypto.diff
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
--- dhcp-4.1.1/configure.ac
|
||||||
|
+++ dhcp-4.1.1/configure.ac 2010/05/03 12:25:59
|
||||||
|
@@ -420,8 +420,13 @@ AC_TRY_LINK(
|
||||||
|
AC_CHECK_HEADERS(sys/socket.h net/if_dl.h net/if6.h regex.h)
|
||||||
|
|
||||||
|
# find an MD5 library
|
||||||
|
+saved_LIBS="$LIBS"
|
||||||
|
+LIBS=""
|
||||||
|
AC_SEARCH_LIBS(MD5_Init, [crypto])
|
||||||
|
AC_SEARCH_LIBS(MD5Init, [crypto])
|
||||||
|
+CRYPTO_LIBS="$LIBS"
|
||||||
|
+LIBS="$saved_LIBS"
|
||||||
|
+AC_SUBST(CRYPTO_LIBS)
|
||||||
|
|
||||||
|
# Solaris needs some libraries for functions
|
||||||
|
AC_SEARCH_LIBS(socket, [socket])
|
@ -1,6 +1,8 @@
|
|||||||
--- client/dhclient.8
|
diff --git a/client/dhclient.8 b/client/dhclient.8
|
||||||
+++ client/dhclient.8 2008/09/08 15:19:13
|
index b805528..d31fa8d 100644
|
||||||
@@ -36,6 +36,9 @@
|
--- a/client/dhclient.8
|
||||||
|
+++ b/client/dhclient.8
|
||||||
|
@@ -60,6 +60,9 @@ dhclient - Dynamic Host Configuration Protocol Client
|
||||||
.I port
|
.I port
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
@ -10,47 +12,50 @@
|
|||||||
.B -d
|
.B -d
|
||||||
]
|
]
|
||||||
[
|
[
|
||||||
@@ -172,6 +175,11 @@
|
@@ -227,6 +230,11 @@ If a different port is specified for the client to listen on and
|
||||||
transmit on, the client will also use a different destination port -
|
transmit on, the client will also use a different destination port -
|
||||||
one less than the specified port.
|
one less than the specified port.
|
||||||
.PP
|
.PP
|
||||||
+The
|
+The
|
||||||
+.B -H
|
+.B -H
|
||||||
+flag may be used to specify a client hostname that should be sent to
|
+flag may be used to specify a client hostname that should be sent to
|
||||||
+the DHCP server.
|
+the DHCP server. Note, that this option is a SUSE/Novell extension.
|
||||||
+.PP
|
+.PP
|
||||||
The DHCP client normally transmits any protocol messages it sends
|
The DHCP client normally transmits any protocol messages it sends
|
||||||
before acquiring an IP address to, 255.255.255.255, the IP limited
|
before acquiring an IP address to, 255.255.255.255, the IP limited
|
||||||
broadcast address. For debugging purposes, it may be useful to have
|
broadcast address. For debugging purposes, it may be useful to have
|
||||||
--- client/dhclient.c
|
diff --git a/client/dhclient.c b/client/dhclient.c
|
||||||
+++ client/dhclient.c 2008/09/08 15:17:50
|
index 15c31a5..65e9c23 100644
|
||||||
@@ -100,6 +100,7 @@ int main (argc, argv, envp)
|
--- a/client/dhclient.c
|
||||||
|
+++ b/client/dhclient.c
|
||||||
|
@@ -108,6 +108,7 @@ main(int argc, char **argv) {
|
||||||
int no_dhclient_db = 0;
|
int no_dhclient_db = 0;
|
||||||
int no_dhclient_pid = 0;
|
int no_dhclient_pid = 0;
|
||||||
int no_dhclient_script = 0;
|
int no_dhclient_script = 0;
|
||||||
+ char *dhclient_hostname = NULL;
|
+ char *dhclient_hostname = NULL;
|
||||||
char *s;
|
#ifdef DHCPv6
|
||||||
|
int local_family_set = 0;
|
||||||
/* Make sure that file descriptors 0 (stdin), 1, (stdout), and
|
#endif /* DHCPv6 */
|
||||||
@@ -189,6 +190,15 @@ int main (argc, argv, envp)
|
@@ -212,6 +213,16 @@ main(int argc, char **argv) {
|
||||||
if (++i == argc)
|
if (++i == argc)
|
||||||
usage ();
|
usage();
|
||||||
relay = argv [i];
|
mockup_relay = argv[i];
|
||||||
+ } else if (!strcmp (argv [i], "-H")) {
|
+ } else if (!strcmp (argv[i], "-H")) {
|
||||||
+ if (++i == argc || !argv[i] || *(argv[i]) == '\0')
|
+ if (++i == argc || !argv[i] || *(argv[i]) == '\0')
|
||||||
+ usage ();
|
+ usage ();
|
||||||
+ if (strlen (argv[i]) > HOST_NAME_MAX) {
|
+ if (strlen (argv[i]) > HOST_NAME_MAX) {
|
||||||
+ log_error("-H option host-name string \"%s\" is too long:"
|
+ log_error("-H option host-name string \"%s\" is too long:"
|
||||||
+ "maximum length is %d characters", argv[i], HOST_NAME_MAX);
|
+ "maximum length is %d characters",
|
||||||
|
+ argv[i], HOST_NAME_MAX);
|
||||||
+ exit(1);
|
+ exit(1);
|
||||||
+ }
|
+ }
|
||||||
+ dhclient_hostname = argv [i];
|
+ dhclient_hostname = argv [i];
|
||||||
} else if (!strcmp (argv [i], "-nw")) {
|
} else if (!strcmp(argv[i], "-nw")) {
|
||||||
nowait = 1;
|
nowait = 1;
|
||||||
} else if (!strcmp (argv [i], "-n")) {
|
} else if (!strcmp(argv[i], "-n")) {
|
||||||
@@ -345,6 +355,32 @@ int main (argc, argv, envp)
|
@@ -445,6 +456,32 @@ main(int argc, char **argv) {
|
||||||
/* Parse the dhclient.conf file. */
|
/* Parse the dhclient.conf file. */
|
||||||
read_client_conf ();
|
read_client_conf();
|
||||||
|
|
||||||
+ /* If the user specified a hostname, send it here and now */
|
+ /* If the user specified a hostname, send it here and now */
|
||||||
+ if ((dhclient_hostname != NULL) && (*dhclient_hostname != '\0') ) {
|
+ if ((dhclient_hostname != NULL) && (*dhclient_hostname != '\0') ) {
|
||||||
@ -79,17 +84,20 @@
|
|||||||
+ }
|
+ }
|
||||||
+
|
+
|
||||||
/* Parse the lease database. */
|
/* Parse the lease database. */
|
||||||
read_client_leases ();
|
read_client_leases();
|
||||||
|
|
||||||
@@ -483,9 +519,9 @@ static void usage ()
|
@@ -653,12 +690,12 @@ static void usage()
|
||||||
log_info (arr);
|
|
||||||
log_info (url);
|
|
||||||
|
|
||||||
- log_error ("Usage: dhclient [-1dqrx] [-nw] [-p <port>] %s",
|
log_error("Usage: dhclient %s %s",
|
||||||
+ log_error ("Usage: dhclient [-1dqrx] [-nw] [-H <hostname>] [-p <port>] %s",
|
#ifdef DHCPv6
|
||||||
"[-s server]");
|
- "[-4|-6] [-SNTP1dvrx] [-nw] [-p <port>]",
|
||||||
- log_error (" [-cf config-file] [-lf lease-file]%s",
|
+ "[-4|-6] [-SNTP1dvrx] [-nw] [-H <hostname>] [-p <port>]",
|
||||||
+ log_error (" [-cf config-file] [-lf lease-file] %s",
|
#else /* DHCPv6 */
|
||||||
"[-pf pid-file] [-e VAR=val]");
|
"[-1dvrx] [-nw] [-p <port>]",
|
||||||
log_fatal (" [-sf script-file] [interface]");
|
#endif /* DHCPv6 */
|
||||||
|
"[-s server]");
|
||||||
|
- log_error(" [-cf config-file] [-lf lease-file]%s",
|
||||||
|
+ log_error(" [-cf config-file] [-lf lease-file] %s",
|
||||||
|
"[-pf pid-file] [-e VAR=val]");
|
||||||
|
log_fatal(" [-sf script-file] [interface]");
|
||||||
}
|
}
|
21
dhcp-4.1.1-in6_pktinfo-prototype.diff
Normal file
21
dhcp-4.1.1-in6_pktinfo-prototype.diff
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
diff --git a/common/socket.c b/common/socket.c
|
||||||
|
index 036f7ae..6f56740 100644
|
||||||
|
--- a/common/socket.c
|
||||||
|
+++ b/common/socket.c
|
||||||
|
@@ -40,11 +40,16 @@
|
||||||
|
* I have implemented it under Linux; other systems should be doable also.
|
||||||
|
*/
|
||||||
|
|
||||||
|
+#ifndef _GNU_SOURCE
|
||||||
|
+#define _GNU_SOURCE
|
||||||
|
+#endif
|
||||||
|
#include "dhcpd.h"
|
||||||
|
#include <errno.h>
|
||||||
|
#include <sys/ioctl.h>
|
||||||
|
#include <sys/uio.h>
|
||||||
|
#include <sys/uio.h>
|
||||||
|
+#include <netinet/in.h> /* for struct in6_pktinfo, with glibc >= 2.10.1
|
||||||
|
+ _GNU_SOURCE required to enable it */
|
||||||
|
|
||||||
|
#ifdef USE_SOCKET_FALLBACK
|
||||||
|
# if !defined (USE_SOCKET_SEND)
|
3
dhcp-4.1.1-ldap-patch-mt-01.diff.bz2
Normal file
3
dhcp-4.1.1-ldap-patch-mt-01.diff.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:176dec01acb2704866f516ed21b6210c9d16bd4667db9b265c57bb2b07735510
|
||||||
|
size 46012
|
26
dhcp-4.1.1-man-includes.diff
Normal file
26
dhcp-4.1.1-man-includes.diff
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
diff --git a/dhcpctl/dhcpctl.3 b/dhcpctl/dhcpctl.3
|
||||||
|
index 2e1cb8a..ee44755 100644
|
||||||
|
--- a/dhcpctl/dhcpctl.3
|
||||||
|
+++ b/dhcpctl/dhcpctl.3
|
||||||
|
@@ -425,7 +425,7 @@ that most error checking has been ommitted for brevity.
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
-#include <isc/result.h>
|
||||||
|
+#include <isc-dhcp/result.h>
|
||||||
|
#include <dhcpctl/dhcpctl.h>
|
||||||
|
|
||||||
|
int main (int argc, char **argv) {
|
||||||
|
diff --git a/omapip/omapi.3 b/omapip/omapi.3
|
||||||
|
index 4673549..8e2503f 100644
|
||||||
|
--- a/omapip/omapi.3
|
||||||
|
+++ b/omapip/omapi.3
|
||||||
|
@@ -87,7 +87,7 @@ the lease ends.
|
||||||
|
#include <stdio.h>
|
||||||
|
#include <netinet/in.h>
|
||||||
|
|
||||||
|
- #include <isc/result.h>
|
||||||
|
+ #include <isc-dhcp/result.h>
|
||||||
|
#include <dhcpctl/dhcpctl.h>
|
||||||
|
|
||||||
|
int main (int argc, char **argv) {
|
63
dhcp-4.1.1-paranoia.diff
Normal file
63
dhcp-4.1.1-paranoia.diff
Normal file
@ -0,0 +1,63 @@
|
|||||||
|
diff --git a/server/dhcpd.c b/server/dhcpd.c
|
||||||
|
index f0cacb6..6e30d33 100644
|
||||||
|
--- a/server/dhcpd.c
|
||||||
|
+++ b/server/dhcpd.c
|
||||||
|
@@ -210,7 +210,11 @@ static void omapi_listener_start (void *foo)
|
||||||
|
#if defined (PARANOIA)
|
||||||
|
/* to be used in one of two possible scenarios */
|
||||||
|
static void setup_chroot (char *chroot_dir) {
|
||||||
|
- if (geteuid())
|
||||||
|
+ /*
|
||||||
|
+ ** getuid() instead of geteuid(), see
|
||||||
|
+ ** comment by thomas@suse.de bellow
|
||||||
|
+ */
|
||||||
|
+ if (getuid())
|
||||||
|
log_fatal ("you must be root to use chroot");
|
||||||
|
|
||||||
|
if (chroot(chroot_dir)) {
|
||||||
|
@@ -402,7 +406,7 @@ main(int argc, char **argv) {
|
||||||
|
log_fatal ("Insufficient memory to %s %s: %s",
|
||||||
|
"record interface", argv [i],
|
||||||
|
isc_result_totext (result));
|
||||||
|
- strcpy (tmp -> name, argv [i]);
|
||||||
|
+ strncpy (tmp -> name, argv [i], sizeof(tmp->name)-1);
|
||||||
|
if (interfaces) {
|
||||||
|
interface_reference (&tmp -> next,
|
||||||
|
interfaces, MDL);
|
||||||
|
@@ -487,7 +491,15 @@ main(int argc, char **argv) {
|
||||||
|
if (set_user) {
|
||||||
|
struct passwd *tmp_pwd;
|
||||||
|
|
||||||
|
- if (geteuid())
|
||||||
|
+ /*
|
||||||
|
+ ** I query for the real UID and not for the effective UID
|
||||||
|
+ ** just to force the user to run this server as root and
|
||||||
|
+ ** not setting it suid. It should be a paranoia patch and
|
||||||
|
+ ** not a teletubbie patch. *eg*
|
||||||
|
+ ** Note: That the user is still able to set it suid! *zitter*
|
||||||
|
+ ** thomas@suse.de
|
||||||
|
+ */
|
||||||
|
+ if (getuid())
|
||||||
|
log_fatal ("you must be root to set user");
|
||||||
|
|
||||||
|
if (!(tmp_pwd = getpwnam(set_user)))
|
||||||
|
@@ -505,7 +517,10 @@ main(int argc, char **argv) {
|
||||||
|
#define group real_group
|
||||||
|
struct group *tmp_grp;
|
||||||
|
|
||||||
|
- if (geteuid())
|
||||||
|
+ /*
|
||||||
|
+ ** getuid() instead of geteuid(), see above
|
||||||
|
+ */
|
||||||
|
+ if (getuid())
|
||||||
|
log_fatal ("you must be root to set group");
|
||||||
|
|
||||||
|
if (!(tmp_grp = getgrnam(set_group)))
|
||||||
|
@@ -751,6 +766,7 @@ main(int argc, char **argv) {
|
||||||
|
/* change uid to the specified one */
|
||||||
|
|
||||||
|
if (set_gid) {
|
||||||
|
+ /* setgroups is done, OK */
|
||||||
|
if (setgroups (0, (void *)0))
|
||||||
|
log_fatal ("setgroups: %m");
|
||||||
|
if (setgid (set_gid))
|
@ -1,6 +1,8 @@
|
|||||||
--- server/db.c
|
diff --git a/server/db.c b/server/db.c
|
||||||
+++ server/db.c 2006/11/07 10:19:41
|
index a4e1558..1d5f5b0 100644
|
||||||
@@ -782,21 +782,16 @@
|
--- a/server/db.c
|
||||||
|
+++ b/server/db.c
|
||||||
|
@@ -1059,21 +1059,16 @@ int new_lease_file ()
|
||||||
|
|
||||||
db_validity = lease_file_is_corrupt;
|
db_validity = lease_file_is_corrupt;
|
||||||
|
|
3
dhcp-4.1.1.tar.bz2
Normal file
3
dhcp-4.1.1.tar.bz2
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
version https://git-lfs.github.com/spec/v1
|
||||||
|
oid sha256:56937cd8e59da6ea0560e82d6b3dd637a96cc3052e0f8e163727c46a22fb87c4
|
||||||
|
size 875897
|
17
dhcp.changes
17
dhcp.changes
@ -1,3 +1,20 @@
|
|||||||
|
-------------------------------------------------------------------
|
||||||
|
Fri May 7 14:10:21 UTC 2010 - mt@suse.de
|
||||||
|
|
||||||
|
- Updated to ISC DHCP 4.1.1, the current 4.x series production
|
||||||
|
release, providing DHCPv6 client/server/relay implementation.
|
||||||
|
The programs act in DHCPv6 mode, when the -6 start option is set.
|
||||||
|
We install separate init scripts with a 6 at the end to handle
|
||||||
|
them, that is /etc/init.d/dhcpd6 and dhrelay6. Further, there is
|
||||||
|
also a link to the binaries with a 6 at the end, e.g. dhclient6,
|
||||||
|
making it visible, that the installed version supports DHCPv6.
|
||||||
|
- Moved additional documentation to a separate dhcp-doc package.
|
||||||
|
- Changed to provide config files and scripts as source files
|
||||||
|
instead of patches to the ISC scripts.
|
||||||
|
- Adopted spec file and config/scripts, merged in all patches.
|
||||||
|
- Implemented RFC 3442 classless static routes support in the
|
||||||
|
dhclient-script (bnc#555870).
|
||||||
|
|
||||||
-------------------------------------------------------------------
|
-------------------------------------------------------------------
|
||||||
Thu Apr 29 11:18:20 UTC 2010 - mt@suse.de
|
Thu Apr 29 11:18:20 UTC 2010 - mt@suse.de
|
||||||
|
|
||||||
|
609
dhcp.spec
609
dhcp.spec
@ -1,5 +1,5 @@
|
|||||||
#
|
#
|
||||||
# spec file for package dhcp (Version 3.1.3.ESV)
|
# spec file for package dhcp (Version 4.1.1)
|
||||||
#
|
#
|
||||||
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
# Copyright (c) 2010 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
@ -18,74 +18,69 @@
|
|||||||
# norootforbuild
|
# norootforbuild
|
||||||
|
|
||||||
|
|
||||||
|
%define isc_version 4.1.1
|
||||||
|
%define susefw2dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
|
||||||
|
%define omc_prefix /usr/share/omc
|
||||||
|
%define omc_svcdir %{omc_prefix}/svcinfo.d
|
||||||
|
%define with_ldap 0
|
||||||
Name: dhcp
|
Name: dhcp
|
||||||
%define isc_version 3.1-ESV
|
%if 0%{?with_ldap:1}
|
||||||
%define susefw2dir %{_sysconfdir}/sysconfig/SuSEfirewall2.d/services
|
|
||||||
%define omc_prefix /usr/share/omc
|
|
||||||
%define omc_svcdir %{omc_prefix}/svcinfo.d
|
|
||||||
%define with_casa 0%{?sles_version} >= 10 || 0%{?suse_version} >= 1110
|
|
||||||
%if 0%{?with_casa:%with_casa}
|
|
||||||
BuildRequires: CASA-devel
|
BuildRequires: CASA-devel
|
||||||
|
BuildRequires: openldap2-devel
|
||||||
%endif
|
%endif
|
||||||
BuildRequires: dos2unix openldap2-devel
|
BuildRequires: dos2unix
|
||||||
License: BSD3c(or similar)
|
License: BSD3c(or similar)
|
||||||
Group: Productivity/Networking/Boot/Servers
|
Group: Productivity/Networking/Boot/Servers
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
Version: 3.1.3.ESV
|
Version: 4.1.1
|
||||||
Release: 1
|
Release: 0
|
||||||
Summary: Common Files Used by ISC DHCP Software
|
Summary: Common Files Used by ISC DHCP Software
|
||||||
Url: http://www.isc.org/isc/dhcp.html
|
Url: http://www.isc.org/software/dhcp
|
||||||
Source0: dhcp-%{isc_version}.tar.bz2
|
Source0: dhcp-%{isc_version}.tar.bz2
|
||||||
#Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{isc_version}.tar.gz
|
#Source0: http://ftp.isc.org/isc/dhcp/dhcp-%{isc_version}.tar.gz
|
||||||
#Source1: http://ftp.isc.org/isc/dhcp/dhcp-%{isc_version}.tar.gz.asc
|
#Source1: http://ftp.isc.org/isc/dhcp/dhcp-%{isc_version}.tar.gz.asc
|
||||||
Source2: rc.dhcpd
|
#
|
||||||
Source3: rc.dhcrelay
|
Source10: rc.dhcpd
|
||||||
Source11: sysconfig.dhcpd
|
Source11: rc.dhcpd6
|
||||||
Source12: sysconfig.syslog-dhcpd
|
Source12: rc.dhcrelay
|
||||||
Source14: sysconfig.dhcrelay
|
Source14: sysconfig.dhcpd
|
||||||
Source15: dhcp.README
|
Source15: sysconfig.syslog-dhcpd
|
||||||
Source16: dhcp.LIESMICH
|
Source16: sysconfig.dhcrelay
|
||||||
Source17: examples.tar.gz
|
Source19: if-up.d.dhcpd-restart-hook
|
||||||
Source18: dhcp.README.upgrade
|
#
|
||||||
Source19: dhcpsync
|
Source20: dhclient.conf
|
||||||
Source20: dhcpsync.8
|
Source21: dhclient6.conf
|
||||||
Source21: DDNS-howto.txt
|
Source22: dhcpd.conf
|
||||||
Source30: http://www.andrew.cmu.edu/~kevinm/dhcp/leasestate
|
Source23: dhcpd6.conf
|
||||||
Source31: http://www.andrew.cmu.edu/~kevinm/dhcp/listlease
|
Source24: dhclient-script
|
||||||
Source32: http://www.andrew.cmu.edu/~kevinm/dhcp/clearip
|
#
|
||||||
Source33: http://www.andrew.cmu.edu/~kevinm/dhcp/reset-ip
|
Source30: dhcpd.xml
|
||||||
Source40: http://www3.baylor.edu/~Jeff_Wilson/GiveAway/leases.awk
|
Source31: dhcpd6.xml
|
||||||
Source41: http://www.suse.de/~poeml/dnscompr.py
|
Source32: SuSEfirewall2.dhcp-server
|
||||||
Source42: dhcpd.xml
|
#
|
||||||
Source43: SuSEfirewall2.dhcp-server
|
Source40: dhcp.LIESMICH
|
||||||
Source44: if-up.d.dhcpd-restart-hook
|
Source41: dhcp.README
|
||||||
Patch0: dhcp-3.1.1-paths.dif
|
Source42: dhcp.README.upgrade
|
||||||
## chroot patch by Ari Edelkind (see readme)
|
Source43: DDNS-howto.txt
|
||||||
## and patch supplied by <thomas@suse.de>
|
Source44: contrib.tar.gz
|
||||||
Patch1: dhcp-3.1.1-paranoia.dif
|
Source45: examples.tar.gz
|
||||||
Patch2: dhcp-3.1.1-omapi-test.c.dif
|
#
|
||||||
Patch3: dhcp-3.1.1-man-includes.dif
|
Patch10: dhcp-4.1.1-default-paths.diff
|
||||||
Patch4: dhcp-3.1.1-tmpfile.dif
|
# paranoia patch is included now, but not the
|
||||||
## LDAP support for DHCP server
|
# additional patch by thomas@suse.de not ...
|
||||||
|
Patch11: dhcp-4.1.1-paranoia.diff
|
||||||
|
Patch12: dhcp-4.1.1-man-includes.diff
|
||||||
|
Patch13: dhcp-4.1.1-tmpfile.diff
|
||||||
|
Patch14: dhcp-4.1.1-in6_pktinfo-prototype.diff
|
||||||
|
Patch20: dhcp-4.1.1-dhclient-exec-filedes.diff
|
||||||
|
Patch21: dhcp-4.1.1-dhclient-send-hostname-rml.diff
|
||||||
## patch lives here: http://www.suse.de/~mt/git/dhcp-ldap.git/
|
## patch lives here: http://www.suse.de/~mt/git/dhcp-ldap.git/
|
||||||
%define DHCPD_LDAP 1
|
%if 0%{?with_ldap:1}
|
||||||
%if %DHCPD_LDAP
|
Patch30: dhcp-4.1.1-ldap-patch-mt-01.diff.bz2
|
||||||
Patch10: dhcp-3.1.3-ldap-patch-mt-01.diff.bz2
|
%else
|
||||||
|
Patch30: dhcp-4.1.1-dhclient-no-libcrypto.diff
|
||||||
%endif
|
%endif
|
||||||
%if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930
|
|
||||||
Patch30: dhcp-3.1.1-pie.dif
|
|
||||||
%endif
|
|
||||||
Patch40: dhcp-3.1.1-dhclient-exec-filedes.dif
|
|
||||||
Patch41: dhcp-3.1.1-dhclient-send-hostname-rml.dif
|
|
||||||
Patch42: dhcp-3.1.1-dhclient-use-script-cmdline.dif
|
|
||||||
Patch50: dhcp-3.1.1-dhclient-conf.dif
|
|
||||||
Patch51: dhcp-3.1.3-dhclient-conf.bnc516459.dif
|
|
||||||
Patch60: dhcp-3.1.3-dhclient-script.dif
|
|
||||||
Patch61: dhcp-3.1.3-dhclient-script.bnc555095.dif
|
|
||||||
Patch62: dhcp-3.1.3-dhclient-script.bnc585380.dif
|
|
||||||
##
|
##
|
||||||
Obsoletes: dhcp-base
|
|
||||||
Provides: dhcp-base:/usr/bin/omshell
|
|
||||||
PreReq: /bin/touch /sbin/chkconfig sysconfig
|
PreReq: /bin/touch /sbin/chkconfig sysconfig
|
||||||
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
||||||
|
|
||||||
@ -93,31 +88,27 @@ BuildRoot: %{_tmppath}/%{name}-%{version}-build
|
|||||||
License: BSD3c(or similar)
|
License: BSD3c(or similar)
|
||||||
Summary: ISC DHCP Server
|
Summary: ISC DHCP Server
|
||||||
Group: Productivity/Networking/Boot/Servers
|
Group: Productivity/Networking/Boot/Servers
|
||||||
Requires: net-tools dhcp
|
Requires: net-tools dhcp = %{version}
|
||||||
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /usr/sbin/useradd
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /usr/sbin/useradd
|
||||||
Provides: dhcp_server dhcp:/usr/sbin/dhcpd
|
Provides: dhcp_server dhcp_server6
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
|
|
||||||
%package client
|
%package client
|
||||||
License: BSD3c(or similar)
|
License: BSD3c(or similar)
|
||||||
Summary: ISC DHCP Client
|
Summary: ISC DHCP Client
|
||||||
Group: Productivity/Networking/Boot/Clients
|
Group: Productivity/Networking/Boot/Clients
|
||||||
Requires: net-tools dhcp /usr/bin/host
|
Requires: net-tools dhcp = %{version} /bin/arping /usr/bin/host
|
||||||
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp /bin/grep
|
||||||
Provides: dhcp_client
|
Provides: dhcp_client dhcp_client6
|
||||||
Provides: dhclient = %{version}
|
|
||||||
Obsoletes: dhclient < %{version}
|
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
|
|
||||||
%package relay
|
%package relay
|
||||||
License: BSD3c(or similar)
|
License: BSD3c(or similar)
|
||||||
Summary: DHCP Relay Agent
|
Summary: ISC DHCP Relay Agent
|
||||||
Group: Productivity/Networking/Boot/Servers
|
Group: Productivity/Networking/Boot/Servers
|
||||||
Requires: net-tools dhcp
|
Requires: net-tools dhcp = %{version}
|
||||||
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp
|
PreReq: %insserv_prereq %fillup_prereq /bin/cat /bin/mkdir /bin/cp
|
||||||
Provides: dhcp_relay
|
Provides: dhcp_relay dhcp_relay6
|
||||||
Provides: dhcrelay = %{version}
|
|
||||||
Obsoletes: dhcrelay < %{version}
|
|
||||||
AutoReqProv: on
|
AutoReqProv: on
|
||||||
|
|
||||||
%package devel
|
%package devel
|
||||||
@ -125,37 +116,36 @@ License: BSD3c(or similar)
|
|||||||
Summary: Header Files and Libraries for dhcpctl API
|
Summary: Header Files and Libraries for dhcpctl API
|
||||||
Group: Development/Libraries/C and C++
|
Group: Development/Libraries/C and C++
|
||||||
Requires: dhcp = %{version}
|
Requires: dhcp = %{version}
|
||||||
%if %ul_version >= 1
|
|
||||||
%define VENDOR UnitedLinux
|
%package doc
|
||||||
%else
|
License: BSD3c(or similar)
|
||||||
%define VENDOR SuSE
|
Summary: Documentation
|
||||||
%endif
|
Group: Productivity/Networking/Boot/Servers
|
||||||
|
|
||||||
|
|
||||||
%description
|
%description
|
||||||
This package contains common files used by both the ISC DHCP server
|
This package contains common programs used by both the ISC DHCP
|
||||||
("dhcp-server" package) and client ("dhcp-client").
|
server ("dhcp-server" package) and client ("dhcp-client") as the
|
||||||
|
omshell and common manual pages.
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Ted Lemon <mellon@fugue.com>
|
Ted Lemon <mellon@fugue.com>
|
||||||
|
|
||||||
|
|
||||||
%description server
|
%description server
|
||||||
This package contains the ISC DHCP server.
|
This package contains the ISC DHCP server.
|
||||||
|
|
||||||
Please read the documentation in /usr/share/doc/packages/dhcp-server
|
Please read the documentation in /usr/share/doc/packages/dhcp-server
|
||||||
regarding configuration of the DHCP server.
|
regarding configuration of the DHCP server.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Ted Lemon <mellon@fugue.com>
|
Ted Lemon <mellon@fugue.com>
|
||||||
|
|
||||||
This package also contains software written by Kevin C. Miller <kevinm@andrew.cmu.edu>
|
This package also contains software written by Kevin C. Miller <kevinm@andrew.cmu.edu>
|
||||||
and Jeff Wilson <wilsonj@cs.ecs.baylor.edu>.
|
and Jeff Wilson <wilsonj@cs.ecs.baylor.edu>.
|
||||||
|
|
||||||
|
|
||||||
%description client
|
%description client
|
||||||
This is an alternative DHCP client, the ISC DHCP client for Linux. Like
|
This is an alternative DHCP client, the ISC DHCP client for Linux. Like
|
||||||
"dhcpcd" (the client that is installed by default), it can be used to
|
"dhcpcd" (the client that is installed by default), it can be used to
|
||||||
@ -167,8 +157,6 @@ It is configurable via the configuration file /etc/dhclient.conf and
|
|||||||
you can define your own 'hooks' to be used by the /sbin/dhclient-script
|
you can define your own 'hooks' to be used by the /sbin/dhclient-script
|
||||||
(which is called by the daemon).
|
(which is called by the daemon).
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Ted Lemon <mellon@fugue.com>
|
Ted Lemon <mellon@fugue.com>
|
||||||
@ -180,310 +168,317 @@ because requests can be broadcast, and they will normally not be
|
|||||||
routed.
|
routed.
|
||||||
|
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Ted Lemon <mellon@fugue.com>
|
||||||
|
|
||||||
%description devel
|
%description doc
|
||||||
This package contains all of the libraries and headers for developing
|
This package contains additional documentation files provided with
|
||||||
with the Internet Software Consortium (ISC) dhcpctl API.
|
the software. The manual pages are in the corresponding packages.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Authors:
|
Authors:
|
||||||
--------
|
--------
|
||||||
Ted Lemon <mellon@fugue.com>
|
Ted Lemon <mellon@fugue.com>
|
||||||
|
|
||||||
|
|
||||||
|
%description devel
|
||||||
|
This package contains all of the libraries and headers for developing
|
||||||
|
with the Internet Software Consortium (ISC) dhcpctl API.
|
||||||
|
|
||||||
|
Authors:
|
||||||
|
--------
|
||||||
|
Ted Lemon <mellon@fugue.com>
|
||||||
|
|
||||||
|
|
||||||
%prep
|
%prep
|
||||||
%setup -q -n %{name}-%{isc_version}
|
%setup -q -n %{name}-%{isc_version}
|
||||||
##
|
##
|
||||||
%patch0 -p0
|
|
||||||
%patch1 -p0
|
|
||||||
%patch2 -p0
|
|
||||||
%patch3 -p0
|
|
||||||
%patch4 -p0
|
|
||||||
%if %DHCPD_LDAP
|
|
||||||
%patch10 -p1
|
%patch10 -p1
|
||||||
|
%patch11 -p1
|
||||||
|
%patch12 -p1
|
||||||
|
%patch13 -p1
|
||||||
|
%patch14 -p1
|
||||||
|
%patch20 -p1
|
||||||
|
%patch21 -p1
|
||||||
|
%if 0%{?with_ldap:%with_ldap}
|
||||||
|
%patch30 -p1
|
||||||
|
%else
|
||||||
|
%patch30 -p1
|
||||||
%endif
|
%endif
|
||||||
%if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930
|
|
||||||
%patch30 -p0
|
|
||||||
%endif
|
|
||||||
%patch40 -p0
|
|
||||||
%patch41 -p0
|
|
||||||
%patch42 -p0
|
|
||||||
%patch50 -p0
|
|
||||||
%patch51 -p0
|
|
||||||
%patch60 -p0
|
|
||||||
%patch61 -p0
|
|
||||||
%patch62 -p0
|
|
||||||
##
|
##
|
||||||
find . -type f -name \*.cat\* -exec rm -f {} \;
|
find . -type f -name \*.cat\* -exec rm -f {} \;
|
||||||
cp -p %{S:2} %{S:3} %{S:11} %{S:12} %{S:14} %{S:32} %{S:33} .
|
|
||||||
for i in README LIESMICH; do
|
|
||||||
sed 's/SuSE/%VENDOR/' $RPM_SOURCE_DIR/dhcp.$i > $i.%VENDOR
|
|
||||||
done
|
|
||||||
cp -p $RPM_SOURCE_DIR/dhcp.README.upgrade README.upgrade
|
|
||||||
cp -p $RPM_SOURCE_DIR/DDNS-howto.txt .
|
|
||||||
echo "exec /usr/bin/genDDNSkey \"$@\"" > genDDNSKey.sh
|
|
||||||
tar xzf $RPM_SOURCE_DIR/examples.tar.gz
|
|
||||||
dos2unix contrib/ms2isc/*
|
dos2unix contrib/ms2isc/*
|
||||||
|
|
||||||
%build
|
%build
|
||||||
export CFLAGS
|
CFLAGS="$RPM_OPT_FLAGS -W -Wall -fno-strict-aliasing -Wno-unused"
|
||||||
CFLAGS="$RPM_OPT_FLAGS -W -Wall -fno-strict-aliasing -Wno-unused -DLDAP_DEPRECATED -DUSE_SSL -DPARANOIA -DHAVE_INET_PTON -DHAVE_INET_NTOP"
|
|
||||||
%if 0%{?with_casa:%with_casa}
|
|
||||||
CFLAGS="$CFLAGS -DLDAP_CASA_AUTH"
|
|
||||||
%endif
|
|
||||||
# seems obsolete (redefined reports) => double check
|
|
||||||
#%ifarch ia64 sparc64 alpha s390x ppc64 x86_64
|
|
||||||
# CFLAGS="$CFLAGS -DPTRSIZE_64BIT"
|
|
||||||
#%endif
|
|
||||||
%ifarch ppc ppc64 s390x
|
%ifarch ppc ppc64 s390x
|
||||||
# bugs 134590, 171532
|
# bugs 134590, 171532
|
||||||
CFLAGS="$CFLAGS -fsigned-char"
|
CFLAGS="$CFLAGS -fsigned-char"
|
||||||
%endif
|
%endif
|
||||||
%if %{?suse_version:%suse_version}%{?!suse_version:99999} > 930
|
|
||||||
%ifarch ia64 %sparc alpha s390x ppc64 x86_64
|
%ifarch ia64 %sparc alpha s390x ppc64 x86_64
|
||||||
CFLAGS="$CFLAGS -fPIE"
|
CFLAGS="$CFLAGS -fPIE"
|
||||||
%else
|
%else
|
||||||
CFLAGS="$CFLAGS -fpie"
|
CFLAGS="$CFLAGS -fpie"
|
||||||
%endif
|
%endif
|
||||||
|
LDFLAGS="-pie"
|
||||||
|
FFLAGS="$CFLAGS"
|
||||||
|
CXXFLAGS="$CFLAGS"
|
||||||
|
export RPM_OPT_FLAGS LDFLAGS
|
||||||
|
export CFLAGS FFLAGS CXXFLAGS
|
||||||
|
#
|
||||||
|
%{?suse_update_config:%{suse_update_config -f}}
|
||||||
|
libtoolize --force
|
||||||
|
autoreconf
|
||||||
|
#
|
||||||
|
%configure \
|
||||||
|
--enable-dhcpv6 \
|
||||||
|
--enable-failover \
|
||||||
|
--enable-paranoia \
|
||||||
|
--enable-early-chroot \
|
||||||
|
%if 0%{?with_ldap:%with_ldap}
|
||||||
|
--enable-ldap-conf \
|
||||||
|
--enable-ldap-casa \
|
||||||
%endif
|
%endif
|
||||||
export DEBUG_FLAGS=$CFLAGS
|
--with-cli-pid-file=%{_localstatedir}/run/dhclient.pid \
|
||||||
./configure
|
--with-cli-lease-file=%{_localstatedir}/lib/dhcp/dhclient.leases \
|
||||||
# first, build binaries which use bsd sockets instead of lpf
|
--with-cli6-pid-file=%{_localstatedir}/run/dhclient6.pid \
|
||||||
cp includes/site.h includes/site.h.save.lpf
|
--with-cli6-lease-file=%{_localstatedir}/lib/dhcp6/dhclient.leases \
|
||||||
echo "#define USE_SOCKETS" >> includes/site.h
|
--with-srv-pid-file=%{_localstatedir}/run/dhcpd.pid \
|
||||||
make %{?_smp_mflags} DEBUG="$DEBUG_FLAGS -W" all
|
--with-srv-lease-file=%{_localstatedir}/lib/dhcp/db/dhcpd.leases \
|
||||||
cp -p work.linux-2.2/server/dhcpd work.linux-2.2/server/dhcpd.bsd
|
--with-srv6-pid-file=%{_localstatedir}/run/dhcpd6.pid \
|
||||||
make clean
|
--with-srv6-lease-file=%{_localstatedir}/lib/dhcp6/db/dhcpd6.leases
|
||||||
# then, build the normal binaries using lpf
|
#
|
||||||
mv includes/site.h.save.lpf includes/site.h
|
make %{?_smp_mflags}
|
||||||
make %{?_smp_mflags} DEBUG="$DEBUG_FLAGS -W" all
|
|
||||||
|
%check
|
||||||
# with a minimal config, see if it runs
|
# with a minimal config, see if it runs
|
||||||
echo "ddns-update-style interim;" > testconf
|
echo "ddns-update-style interim;" > testconf
|
||||||
work.linux-2.2/server/dhcpd -t -cf testconf || exit 1
|
./server/dhcpd -4 -t -cf testconf || exit 1
|
||||||
|
./server/dhcpd -6 -t -cf testconf || exit 1
|
||||||
|
# check syntax in our scripts
|
||||||
|
bash -n $RPM_SOURCE_DIR/rc.dhcpd
|
||||||
|
bash -n $RPM_SOURCE_DIR/rc.dhcpd6
|
||||||
|
bash -n $RPM_SOURCE_DIR/rc.dhcrelay
|
||||||
|
bash -n $RPM_SOURCE_DIR/rc.dhcrelay6
|
||||||
|
bash -n $RPM_SOURCE_DIR/dhclient-script
|
||||||
|
|
||||||
%install
|
%install
|
||||||
MANDIR=%{_mandir} DESTDIR=$RPM_BUILD_ROOT LIBDIR=%{_libdir} make install
|
export RPM_BUILD_ROOT
|
||||||
install -m 744 work.linux-2.2/omapip/svtest $RPM_BUILD_ROOT/usr/sbin/svtest
|
make install DESTDIR="$RPM_BUILD_ROOT"
|
||||||
install -m 644 work.linux-2.2/dst/libdst.a $RPM_BUILD_ROOT/%{_libdir}
|
#
|
||||||
# install the saved bsd flavor binary
|
# directories
|
||||||
install -m 755 work.linux-2.2/server/dhcpd.bsd $RPM_BUILD_ROOT/usr/sbin/dhcpd.bsd
|
install -d -m0755 $RPM_BUILD_ROOT/sbin
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/init.d
|
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/init.d
|
||||||
mkdir -p $RPM_BUILD_ROOT/%{susefw2dir}
|
install -d -m0755 $RPM_BUILD_ROOT/%{susefw2dir}
|
||||||
mkdir -p $RPM_BUILD_ROOT/%{omc_svcdir}
|
install -d -m0755 $RPM_BUILD_ROOT/%{omc_svcdir}
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/adm/fillup-templates
|
install -d -m0755 $RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/run
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/run
|
||||||
# set up chroot jail
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/etc
|
# chroot jail
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/dev
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/etc
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/%_lib
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/dev
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/var/run
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/%_lib
|
||||||
mkdir -p $RPM_BUILD_ROOT/var/lib/dhcp/db
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/var/run
|
||||||
%if %DHCPD_LDAP
|
install -d -m0755 $RPM_BUILD_ROOT%{_localstatedir}/lib/{dhcp,dhcp6}/db
|
||||||
mkdir -p $RPM_BUILD_ROOT/etc/openldap/schema
|
# move the dhclient binary to /sbin
|
||||||
install -m 644 contrib/dhcp.schema $RPM_BUILD_ROOT/etc/openldap/schema/
|
mv -f $RPM_BUILD_ROOT/usr/sbin/dhclient $RPM_BUILD_ROOT/sbin/
|
||||||
%endif
|
# provide a ...6 link, so we know it supports DHCPv6
|
||||||
install -m 744 rc.dhcpd $RPM_BUILD_ROOT/etc/init.d/dhcpd
|
ln -sf dhcpd $RPM_BUILD_ROOT%{_sbindir}/dhcpd6
|
||||||
install -m 744 rc.dhcrelay $RPM_BUILD_ROOT/etc/init.d/dhcrelay
|
ln -sf dhcrelay $RPM_BUILD_ROOT%{_sbindir}/dhcrelay6
|
||||||
ln -sf ../../etc/init.d/dhcpd $RPM_BUILD_ROOT/usr/sbin/rcdhcpd
|
ln -sf dhclient $RPM_BUILD_ROOT/sbin/dhclient6
|
||||||
ln -sf ../../etc/init.d/dhcrelay $RPM_BUILD_ROOT/usr/sbin/rcdhcrelay
|
# install our adopted config examples and dhclient-script:
|
||||||
install -m 755 $RPM_SOURCE_DIR/dhcpsync $RPM_BUILD_ROOT/usr/sbin/
|
install -m0644 $RPM_SOURCE_DIR/dhcpd.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
||||||
install -m 644 $RPM_SOURCE_DIR/dhcpsync.8 $RPM_BUILD_ROOT/%{_mandir}/man8/
|
install -m0644 $RPM_SOURCE_DIR/dhcpd6.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
||||||
install -m 755 $RPM_SOURCE_DIR/leasestate $RPM_BUILD_ROOT/usr/sbin/
|
install -m0644 $RPM_SOURCE_DIR/dhclient.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
||||||
install -m 755 $RPM_SOURCE_DIR/listlease $RPM_BUILD_ROOT/usr/sbin/
|
install -m0644 $RPM_SOURCE_DIR/dhclient6.conf $RPM_BUILD_ROOT%{_sysconfdir}/
|
||||||
install -m 755 $RPM_SOURCE_DIR/leases.awk $RPM_BUILD_ROOT/usr/sbin/
|
install -m0750 $RPM_SOURCE_DIR/dhclient-script $RPM_BUILD_ROOT/sbin/
|
||||||
cp -p $RPM_SOURCE_DIR/dnscompr.py .
|
# init scripts
|
||||||
install -m 644 sysconfig.dhcpd $RPM_BUILD_ROOT/var/adm/fillup-templates/
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcpd \
|
||||||
install -m 644 sysconfig.syslog-dhcpd $RPM_BUILD_ROOT/var/adm/fillup-templates/
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd
|
||||||
install -m 644 sysconfig.dhcrelay $RPM_BUILD_ROOT/var/adm/fillup-templates/
|
ln -sf %{_sysconfdir}/init.d/dhcpd \
|
||||||
rm -f $RPM_BUILD_ROOT/var/lib/dhcp/dhcpd.leases
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcpd
|
||||||
install -m 644 client/dhclient.conf $RPM_BUILD_ROOT/etc/dhclient.conf
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcpd6 \
|
||||||
sed '/^max-lease-time/ a \
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcpd6
|
||||||
\
|
ln -sf %{_sysconfdir}/init.d/dhcpd6 \
|
||||||
# if you do not use dynamical DNS updates:\
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcpd6
|
||||||
#\
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay \
|
||||||
# this statement is needed by dhcpd-3 needs at least this statement.\
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay
|
||||||
# you have to delete it for dhcpd-2, because it does not know it.\
|
ln -sf %{_sysconfdir}/init.d/dhcrelay \
|
||||||
#\
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay
|
||||||
# if you want to use dynamical DNS updates, you should first read\
|
install -m0755 $RPM_SOURCE_DIR/rc.dhcrelay6 \
|
||||||
# read /usr/share/doc/packages/dhcp-server/DDNS-howto.txt\
|
$RPM_BUILD_ROOT%{_sysconfdir}/init.d/dhcrelay6
|
||||||
ddns-update-style none; ddns-updates off;\
|
ln -sf %{_sysconfdir}/init.d/dhcrelay6 \
|
||||||
' server/dhcpd.conf > dhcpd.conf
|
$RPM_BUILD_ROOT%{_sbindir}/rcdhcrelay6
|
||||||
install -m644 contrib/3.0b1-lease-convert 3.0b1-lease-convert
|
# sysconfig files
|
||||||
find $RPM_BUILD_ROOT/%{_mandir} -type f | xargs chmod 644
|
install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcpd \
|
||||||
install -m 644 $RPM_SOURCE_DIR/dhcpd.xml $RPM_BUILD_ROOT/%{omc_svcdir}/
|
$RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/
|
||||||
install -m 644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp-server \
|
install -m0644 $RPM_SOURCE_DIR/sysconfig.syslog-dhcpd \
|
||||||
$RPM_BUILD_ROOT/%{susefw2dir}/dhcp-server
|
$RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/
|
||||||
install -m 755 -d $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d
|
install -m0644 $RPM_SOURCE_DIR/sysconfig.dhcrelay \
|
||||||
install -m 755 -d $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
|
$RPM_BUILD_ROOT%{_localstatedir}/adm/fillup-templates/
|
||||||
install -m 755 $RPM_SOURCE_DIR/if-up.d.dhcpd-restart-hook \
|
# another config files and scripts
|
||||||
|
install -m0644 contrib/dhcp.schema \
|
||||||
|
$RPM_BUILD_ROOT%{_sysconfdir}/openldap/schema
|
||||||
|
install -m0644 $RPM_SOURCE_DIR/dhcpd.xml \
|
||||||
|
$RPM_SOURCE_DIR/dhcpd6.xml \
|
||||||
|
$RPM_BUILD_ROOT/%{omc_svcdir}/
|
||||||
|
install -m0644 $RPM_SOURCE_DIR/SuSEfirewall2.dhcp-server \
|
||||||
|
$RPM_BUILD_ROOT/%{susefw2dir}/dhcp-server
|
||||||
|
install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d
|
||||||
|
install -d -m0755 $RPM_BUILD_ROOT/etc/sysconfig/network/scripts
|
||||||
|
install -m0755 $RPM_SOURCE_DIR/if-up.d.dhcpd-restart-hook \
|
||||||
$RPM_BUILD_ROOT/etc/sysconfig/network/scripts/dhcpd-restart-hook
|
$RPM_BUILD_ROOT/etc/sysconfig/network/scripts/dhcpd-restart-hook
|
||||||
ln -sf ../scripts/dhcpd-restart-hook \
|
ln -sf ../scripts/dhcpd-restart-hook \
|
||||||
$RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/60-dhcpd-restart-hook
|
$RPM_BUILD_ROOT/etc/sysconfig/network/if-up.d/60-dhcpd-restart-hook
|
||||||
|
# fix manual page permissions
|
||||||
%pre
|
find $RPM_BUILD_ROOT/%{_mandir} -type f | xargs chmod 644
|
||||||
# In the past, the name of the source package was "dhcp" but the subpackage
|
# copy some documentation and examples from src dir
|
||||||
# with the common files was named "dhcp-base" -- thus, no subpackage had the
|
install -m0644 $RPM_SOURCE_DIR/dhcp.LIESMICH LIESMICH.SuSE
|
||||||
# same name as the parent package. This lead to trouble on various ends, like
|
install -m0644 $RPM_SOURCE_DIR/dhcp.README README.SuSE
|
||||||
# the putonftp mechanism, so "dhcp-base" was renamed to "dhcp".
|
install -m0644 $RPM_SOURCE_DIR/dhcp.README.upgrade README.upgrade
|
||||||
#
|
install -m0644 $RPM_SOURCE_DIR/DDNS-howto.txt .
|
||||||
# During a YaST system update, the first package to be updated is "dhcp", which
|
tar xzf $RPM_SOURCE_DIR/contrib.tar.gz
|
||||||
# should --and does-- obsolete the dhcp-base package.
|
mv doc/examples .
|
||||||
# However, if RPMv4 is used, there is a peculiarity: RPMv4 automatically
|
tar xzf $RPM_SOURCE_DIR/examples.tar.gz
|
||||||
# invents an 'obsolete' when it sees a 'provides'.
|
rm -f doc/{References.xml,Makefile*}
|
||||||
# Since the old dhcp-server package (SLES8) did provide
|
rm -f contrib/dhcp.spec
|
||||||
# Provides: dhcp_server dhcp:/usr/sbin/dhcpd dhcp
|
%if ! 0%{?with_ldap:%with_ldap}
|
||||||
# RPMv4 removes the dhcp-server package.
|
rm -f doc/draft-ietf-dhc-ldap-schema-01.txt
|
||||||
#
|
rm -f contrib/dhcp.schema README.ldap
|
||||||
# This in itself is not a problem because the package is re-installed later
|
rm -f contrib/dhcpd-conf-to-ldap.pl
|
||||||
# (RPMv4 is not that intelligent). However, if the service is destined to be
|
%endif
|
||||||
# started at boot time, the runlevel links will be gone, so the service will
|
|
||||||
# not be started after the update. To restore the links, there is no better way
|
|
||||||
# than remember that the service was running before updating the "dhcp" package,
|
|
||||||
# and restore the links at "dhcp-server" installation time.
|
|
||||||
if [ ${1:-0} -gt 1 ]; then # update
|
|
||||||
if sbin/chkconfig -c dhcpd; then
|
|
||||||
touch var/adm/dhcpd_needs_insserv
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
|
|
||||||
%pre server
|
%pre server
|
||||||
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||:
|
/usr/sbin/useradd -r -g nogroup -s /bin/false -c "DHCP server daemon" -d /var/lib/dhcp dhcpd 2> /dev/null ||:
|
||||||
if [ ! -x usr/sbin/dhcpd.lpf -a \
|
|
||||||
! -d usr/share/doc/packages/dhcp-server/ms2isc ]; then
|
|
||||||
# usr/sbin/dhcpd.lpf was added _after_ release of 9.1;
|
|
||||||
# usr/share/doc/packages/dhcp-server/ms2isc was added with 9.0;
|
|
||||||
# thus, if both are not present we are updating from pre 9.0 AND
|
|
||||||
# we are NOT updating a 9.1 released package (that has not been updated before).
|
|
||||||
# 9.0 already had a binary compiled with BSD sockets.
|
|
||||||
touch etc/dhcpd_updating_from_lpf_style
|
|
||||||
fi
|
|
||||||
|
|
||||||
%post server
|
%post server
|
||||||
%{fillup_and_insserv -n dhcpd dhcpd}
|
%{fillup_and_insserv -n dhcpd dhcpd dhcpd6}
|
||||||
%{fillup_only -ans syslog dhcpd}
|
%{fillup_only -ans syslog dhcpd}
|
||||||
if grep -q '^DHCPD_RUN_AS="nobody"' etc/sysconfig/dhcpd; then
|
|
||||||
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
|
||||||
sed 's|^DHCPD_RUN_AS="nobody"|DHCPD_RUN_AS="dhcpd"|' etc/sysconfig/dhcpd \
|
|
||||||
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
|
||||||
rm -f $tmpfile
|
|
||||||
fi
|
|
||||||
# update?
|
# update?
|
||||||
if [ ${FIRST_ARG:-0} -gt 1 ]; then
|
if [ ${FIRST_ARG:-0} -gt 1 ]; then
|
||||||
if [ -e etc/dhcpd_updating_from_lpf_style -a -x usr/sbin/dhcpd.lpf ]; then
|
if grep -q '^DHCPD_RUN_AS=.*nobody' etc/sysconfig/dhcpd; then
|
||||||
if /etc/init.d/dhcpd status &>/dev/null; then
|
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
||||||
was_running=true
|
sed 's|^DHCPD_RUN_AS=.*|DHCPD_RUN_AS="dhcpd"|' etc/sysconfig/dhcpd \
|
||||||
/etc/init.d/dhcpd stop
|
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
||||||
else
|
rm -f $tmpfile
|
||||||
was_running=false
|
fi
|
||||||
fi
|
if grep -q '^DHCPD_BINARY=.*dhcpd\..*' etc/sysconfig/dhcpd; then
|
||||||
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
tmpfile=$(mktemp -q etc/sysconfig/dhcpd.XXXXXX)
|
||||||
sed 's|^DHCPD_BINARY=""|DHCPD_BINARY="/usr/sbin/dhcpd.lpf"|' etc/sysconfig/dhcpd \
|
sed 's|^DHCPD_BINARY=.*|DHCPD_BINARY=""|' etc/sysconfig/dhcpd \
|
||||||
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
> $tmpfile && mv $tmpfile etc/sysconfig/dhcpd
|
||||||
rm -f $tmpfile
|
rm -f $tmpfile
|
||||||
if $was_running; then
|
fi
|
||||||
/etc/init.d/dhcpd start
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
# see comment above
|
|
||||||
if [ -f var/adm/dhcpd_needs_insserv ]; then
|
|
||||||
sbin/insserv dhcpd
|
|
||||||
rm var/adm/dhcpd_needs_insserv
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
rm -f etc/dhcpd_updating_from_lpf_style
|
|
||||||
test -s etc/dhcpd.conf || { cp -p usr/share/doc/packages/dhcp-server/dhcpd.conf etc/; }
|
|
||||||
exit 0
|
exit 0
|
||||||
|
|
||||||
%postun server
|
|
||||||
%restart_on_update dhcpd
|
|
||||||
%insserv_cleanup
|
|
||||||
|
|
||||||
%preun server
|
%preun server
|
||||||
%stop_on_removal dhcpd
|
%stop_on_removal dhcpd
|
||||||
|
%stop_on_removal dhcpd6
|
||||||
|
|
||||||
|
%postun server
|
||||||
|
%restart_on_update dhcpd
|
||||||
|
%restart_on_update dhcpd6
|
||||||
|
%insserv_cleanup
|
||||||
|
|
||||||
%post relay
|
%post relay
|
||||||
%{fillup_and_insserv -n dhcrelay dhcrelay}
|
%{fillup_and_insserv -n dhcrelay dhcrelay dhcrelay6}
|
||||||
|
|
||||||
%postun relay
|
|
||||||
%restart_on_update dhcrelay
|
|
||||||
%insserv_cleanup
|
|
||||||
|
|
||||||
%preun relay
|
%preun relay
|
||||||
%stop_on_removal dhcrelay
|
%stop_on_removal dhcrelay
|
||||||
|
%stop_on_removal dhcrelay6
|
||||||
|
|
||||||
|
%postun relay
|
||||||
|
%restart_on_update dhcrelay
|
||||||
|
%restart_on_update dhcrelay6
|
||||||
|
%insserv_cleanup
|
||||||
|
|
||||||
%post client
|
%post client
|
||||||
touch var/lib/dhcp/dhclient.leases
|
test -e %{_localstatedir}/lib/dhcp/dhclient.leases || \
|
||||||
|
touch %{_localstatedir}/lib/dhcp/dhclient.leases
|
||||||
|
test -e %{_localstatedir}/lib/dhcp6/dhclient6.leases || \
|
||||||
|
touch %{_localstatedir}/lib/dhcp6/dhclient6.leases
|
||||||
|
|
||||||
%clean
|
%clean
|
||||||
if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
|
if ! test -f /.buildenv; then rm -rf $RPM_BUILD_ROOT; fi
|
||||||
|
|
||||||
%files
|
%files
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc LICENSE README RELNOTES doc
|
%config %{susefw2dir}/dhcp-server
|
||||||
/usr/bin/omshell
|
%{_bindir}/omshell
|
||||||
%dir /var/lib/dhcp
|
|
||||||
%doc %{_mandir}/man1/omshell.1.gz
|
%doc %{_mandir}/man1/omshell.1.gz
|
||||||
%doc %{_mandir}/man5/dhcp-eval.5.gz
|
%doc %{_mandir}/man5/dhcp-eval.5.gz
|
||||||
%config %{susefw2dir}/dhcp-server
|
%doc %{_mandir}/man5/dhcp-options.5.gz
|
||||||
|
|
||||||
|
%files doc
|
||||||
|
%defattr(-,root,root)
|
||||||
|
%doc LICENSE README RELNOTES
|
||||||
|
%doc LIESMICH.* README.*
|
||||||
|
%doc DDNS-howto.txt doc/*
|
||||||
|
%doc contrib examples
|
||||||
|
|
||||||
%files server
|
%files server
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
%doc clearip reset-ip
|
%{_sbindir}/dhcpd
|
||||||
%doc dnscompr.py
|
%{_sbindir}/dhcpd6
|
||||||
/usr/sbin/dhcpd
|
%{_sbindir}/rcdhcpd
|
||||||
/usr/sbin/dhcpd.bsd
|
%{_sbindir}/rcdhcpd6
|
||||||
/usr/sbin/rcdhcpd
|
%config %{_sysconfdir}/init.d/dhcpd
|
||||||
/usr/sbin/svtest
|
%config %{_sysconfdir}/init.d/dhcpd6
|
||||||
%config /usr/sbin/dhcpsync
|
%config(noreplace) %{_sysconfdir}/dhcpd.conf
|
||||||
%config /usr/sbin/leasestate
|
%config(noreplace) %{_sysconfdir}/dhcpd6.conf
|
||||||
%config /usr/sbin/listlease
|
%dir %{_localstatedir}/lib/dhcp
|
||||||
%config /usr/sbin/leases.awk
|
%dir %{_localstatedir}/lib/dhcp/etc
|
||||||
%config /etc/init.d/dhcpd
|
%dir %{_localstatedir}/lib/dhcp/dev
|
||||||
%dir /var/lib/dhcp/var
|
%dir %{_localstatedir}/lib/dhcp/%_lib
|
||||||
%dir /var/lib/dhcp/var/run
|
%dir %{_localstatedir}/lib/dhcp/var
|
||||||
%attr(755,dhcpd,root) %dir /var/lib/dhcp/db
|
%dir %{_localstatedir}/lib/dhcp/var/run
|
||||||
%dir /var/lib/dhcp/etc
|
%attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp/db
|
||||||
%dir /var/lib/dhcp/dev
|
%dir %{_localstatedir}/lib/dhcp6
|
||||||
%doc %{_mandir}/man5/dhcpd.conf.5.gz
|
%dir %{_localstatedir}/lib/dhcp6/etc
|
||||||
%doc %{_mandir}/man5/dhcp-options.5.gz
|
%dir %{_localstatedir}/lib/dhcp6/dev
|
||||||
%doc %{_mandir}/man5/dhcpd.leases.5.gz
|
%dir %{_localstatedir}/lib/dhcp6/%_lib
|
||||||
|
%dir %{_localstatedir}/lib/dhcp6/var
|
||||||
|
%dir %{_localstatedir}/lib/dhcp6/var/run
|
||||||
|
%attr(755,dhcpd,root) %dir %{_localstatedir}/lib/dhcp6/db
|
||||||
%doc %{_mandir}/man8/dhcpd.8.gz
|
%doc %{_mandir}/man8/dhcpd.8.gz
|
||||||
%doc %{_mandir}/man8/dhcpsync.8.gz
|
%doc %{_mandir}/man5/dhcpd.conf.5.gz
|
||||||
%doc dhcpd.conf LIESMICH.%VENDOR README.%VENDOR README.upgrade 3.0b1-lease-convert DDNS-howto.txt genDDNSKey.sh
|
%doc %{_mandir}/man5/dhcpd.leases.5.gz
|
||||||
%doc examples
|
%if 0%{?with_ldap:1}
|
||||||
%doc contrib/ms2isc
|
%dir %{_sysconfdir}/openldap
|
||||||
%if %DHCPD_LDAP
|
%dir %{_sysconfdir}/openldap/schema
|
||||||
%doc contrib/dhcp.schema
|
%attr(0644, root, root) %config %{_sysconfdir}/openldap/schema/dhcp.schema
|
||||||
%doc contrib/dhcpd-conf-to-ldap.pl
|
|
||||||
%doc README.ldap doc/draft-ietf-dhc-ldap-schema-01.txt
|
|
||||||
%dir /etc/openldap
|
|
||||||
%dir /etc/openldap/schema
|
|
||||||
%attr(0644, root, root) %config /etc/openldap/schema/dhcp.schema
|
|
||||||
%endif
|
%endif
|
||||||
/var/adm/fillup-templates/sysconfig.dhcpd
|
|
||||||
/var/adm/fillup-templates/sysconfig.syslog-dhcpd
|
|
||||||
%dir /var/lib/dhcp/%_lib
|
|
||||||
%{omc_svcdir}/dhcpd.xml
|
%{omc_svcdir}/dhcpd.xml
|
||||||
/etc/sysconfig/network/scripts/dhcpd-restart-hook
|
%{omc_svcdir}/dhcpd6.xml
|
||||||
/etc/sysconfig/network/if-up.d/60-dhcpd-restart-hook
|
%{_sysconfdir}/sysconfig/network/scripts/dhcpd-restart-hook
|
||||||
|
%{_sysconfdir}/sysconfig/network/if-up.d/60-dhcpd-restart-hook
|
||||||
|
%{_localstatedir}/adm/fillup-templates/sysconfig.dhcpd
|
||||||
|
%{_localstatedir}/adm/fillup-templates/sysconfig.syslog-dhcpd
|
||||||
|
|
||||||
%files client
|
%files client
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
/sbin/dhclient
|
/sbin/dhclient
|
||||||
|
/sbin/dhclient6
|
||||||
/sbin/dhclient-script
|
/sbin/dhclient-script
|
||||||
%config(noreplace) /etc/dhclient.conf
|
%config(noreplace) %{_sysconfdir}/dhclient.conf
|
||||||
|
%config(noreplace) %{_sysconfdir}/dhclient6.conf
|
||||||
%doc %{_mandir}/man5/dhclient.conf.5.gz
|
%doc %{_mandir}/man5/dhclient.conf.5.gz
|
||||||
%doc %{_mandir}/man5/dhclient.leases.5.gz
|
%doc %{_mandir}/man5/dhclient.leases.5.gz
|
||||||
%doc %{_mandir}/man8/dhclient.8.gz
|
%doc %{_mandir}/man8/dhclient.8.gz
|
||||||
%doc %{_mandir}/man8/dhclient-script.8.gz
|
%doc %{_mandir}/man8/dhclient-script.8.gz
|
||||||
|
%dir %{_localstatedir}/lib/dhcp
|
||||||
|
%dir %{_localstatedir}/lib/dhcp6
|
||||||
|
|
||||||
%files relay
|
%files relay
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
/usr/sbin/dhcrelay
|
%{_sbindir}/dhcrelay
|
||||||
/usr/sbin/rcdhcrelay
|
%{_sbindir}/dhcrelay6
|
||||||
%config /etc/init.d/dhcrelay
|
%{_sbindir}/rcdhcrelay
|
||||||
|
%{_sbindir}/rcdhcrelay6
|
||||||
|
%config %{_sysconfdir}/init.d/dhcrelay
|
||||||
|
%config %{_sysconfdir}/init.d/dhcrelay6
|
||||||
%doc %{_mandir}/man8/dhcrelay.8.gz
|
%doc %{_mandir}/man8/dhcrelay.8.gz
|
||||||
/var/adm/fillup-templates/sysconfig.dhcrelay
|
%{_localstatedir}/adm/fillup-templates/sysconfig.dhcrelay
|
||||||
|
|
||||||
%files devel
|
%files devel
|
||||||
%defattr(-,root,root)
|
%defattr(-,root,root)
|
||||||
|
138
dhcpd.conf
Normal file
138
dhcpd.conf
Normal file
@ -0,0 +1,138 @@
|
|||||||
|
# dhcpd.conf
|
||||||
|
#
|
||||||
|
# Sample configuration file for ISC dhcpd
|
||||||
|
#
|
||||||
|
|
||||||
|
# option definitions common to all supported networks...
|
||||||
|
option domain-name "example.org";
|
||||||
|
option domain-name-servers ns1.example.org, ns2.example.org;
|
||||||
|
|
||||||
|
default-lease-time 600;
|
||||||
|
max-lease-time 7200;
|
||||||
|
|
||||||
|
# if you do not use dynamical DNS updates:
|
||||||
|
#
|
||||||
|
# if you want to use dynamical DNS updates, you should first read
|
||||||
|
# read /usr/share/doc/packages/dhcp-server/DDNS-howto.txt
|
||||||
|
#
|
||||||
|
ddns-updates off;
|
||||||
|
|
||||||
|
# Use this to enble / disable dynamic dns updates globally.
|
||||||
|
ddns-update-style none;
|
||||||
|
|
||||||
|
# If this DHCP server is the official DHCP server for the local
|
||||||
|
# network, the authoritative directive should be uncommented.
|
||||||
|
#authoritative;
|
||||||
|
|
||||||
|
# Use this to send dhcp log messages to a different log file (you also
|
||||||
|
# have to hack syslog.conf to complete the redirection).
|
||||||
|
log-facility local7;
|
||||||
|
|
||||||
|
#
|
||||||
|
# Define RFC 3442 classless static route option (121);
|
||||||
|
# the following _example_ routes:
|
||||||
|
# 192.168.2.254/32 via 0.0.0.0 (device route)
|
||||||
|
# 192.168.2.253/32 via 192.168.1.2 (255.255.255.255)
|
||||||
|
# 192.2.0.128/25 via 192.168.1.2 (255.255.255.128)
|
||||||
|
# 192.168.2.0/24 via 192.168.1.2 (255.255.255.0)
|
||||||
|
# 172.16.0.0/12 via 192.168.1.2 (255.240.0.0)
|
||||||
|
# 10.0.0.0/8 via 192.168.1.2 (255.0.0.0)
|
||||||
|
# default via 192.168.1.1
|
||||||
|
# have to be written as:
|
||||||
|
# option rfc3442-classless-static-routes
|
||||||
|
# 32, 192, 168, 2, 254, 0, 0, 0, 0,
|
||||||
|
# 32, 192, 168, 2, 253, 192, 168, 1, 2,
|
||||||
|
# 25, 192, 2, 0, 128, 192, 168, 1, 2,
|
||||||
|
# 24, 192, 168, 3, 192, 168, 1, 2,
|
||||||
|
# 12, 172, 16, 192, 168, 1, 2,
|
||||||
|
# 8, 10, 192, 168, 1, 2,
|
||||||
|
# 0, 192, 168, 1, 1;
|
||||||
|
#
|
||||||
|
# Note: you have to specify the default gateway here
|
||||||
|
# as well, because when classless routes are in use,
|
||||||
|
# the 'routers' option is ignored by the dhcp client.
|
||||||
|
#
|
||||||
|
option rfc3442-classless-static-routes code 121 = array of unsigned integer 8;
|
||||||
|
|
||||||
|
|
||||||
|
# No service will be given on this subnet, but declaring it helps the
|
||||||
|
# DHCP server to understand the network topology.
|
||||||
|
|
||||||
|
subnet 10.152.187.0 netmask 255.255.255.0 {
|
||||||
|
}
|
||||||
|
|
||||||
|
# This is a very basic subnet declaration.
|
||||||
|
|
||||||
|
subnet 10.254.239.0 netmask 255.255.255.224 {
|
||||||
|
range 10.254.239.10 10.254.239.20;
|
||||||
|
option routers rtr-239-0-1.example.org, rtr-239-0-2.example.org;
|
||||||
|
}
|
||||||
|
|
||||||
|
# This declaration allows BOOTP clients to get dynamic addresses,
|
||||||
|
# which we don't really recommend.
|
||||||
|
|
||||||
|
subnet 10.254.239.32 netmask 255.255.255.224 {
|
||||||
|
range dynamic-bootp 10.254.239.40 10.254.239.60;
|
||||||
|
option broadcast-address 10.254.239.31;
|
||||||
|
option routers rtr-239-32-1.example.org;
|
||||||
|
}
|
||||||
|
|
||||||
|
# A slightly different configuration for an internal subnet.
|
||||||
|
subnet 10.5.5.0 netmask 255.255.255.224 {
|
||||||
|
range 10.5.5.26 10.5.5.30;
|
||||||
|
option domain-name-servers ns1.internal.example.org;
|
||||||
|
option domain-name "internal.example.org";
|
||||||
|
option routers 10.5.5.1;
|
||||||
|
option broadcast-address 10.5.5.31;
|
||||||
|
default-lease-time 600;
|
||||||
|
max-lease-time 7200;
|
||||||
|
}
|
||||||
|
|
||||||
|
# Hosts which require special configuration options can be listed in
|
||||||
|
# host statements. If no address is specified, the address will be
|
||||||
|
# allocated dynamically (if possible), but the host-specific information
|
||||||
|
# will still come from the host declaration.
|
||||||
|
|
||||||
|
host passacaglia {
|
||||||
|
hardware ethernet 0:0:c0:5d:bd:95;
|
||||||
|
filename "vmunix.passacaglia";
|
||||||
|
server-name "toccata.fugue.com";
|
||||||
|
}
|
||||||
|
|
||||||
|
# Fixed IP addresses can also be specified for hosts. These addresses
|
||||||
|
# should not also be listed as being available for dynamic assignment.
|
||||||
|
# Hosts for which fixed IP addresses have been specified can boot using
|
||||||
|
# BOOTP or DHCP. Hosts for which no fixed address is specified can only
|
||||||
|
# be booted with DHCP, unless there is an address range on the subnet
|
||||||
|
# to which a BOOTP client is connected which has the dynamic-bootp flag
|
||||||
|
# set.
|
||||||
|
host fantasia {
|
||||||
|
hardware ethernet 08:00:07:26:c0:a5;
|
||||||
|
fixed-address fantasia.fugue.com;
|
||||||
|
}
|
||||||
|
|
||||||
|
# You can declare a class of clients and then do address allocation
|
||||||
|
# based on that. The example below shows a case where all clients
|
||||||
|
# in a certain class get addresses on the 10.17.224/24 subnet, and all
|
||||||
|
# other clients get addresses on the 10.0.29/24 subnet.
|
||||||
|
|
||||||
|
class "foo" {
|
||||||
|
match if substring (option vendor-class-identifier, 0, 4) = "SUNW";
|
||||||
|
}
|
||||||
|
|
||||||
|
shared-network 224-29 {
|
||||||
|
subnet 10.17.224.0 netmask 255.255.255.0 {
|
||||||
|
option routers rtr-224.example.org;
|
||||||
|
}
|
||||||
|
subnet 10.0.29.0 netmask 255.255.255.0 {
|
||||||
|
option routers rtr-29.example.org;
|
||||||
|
}
|
||||||
|
pool {
|
||||||
|
allow members of "foo";
|
||||||
|
range 10.17.224.10 10.17.224.250;
|
||||||
|
}
|
||||||
|
pool {
|
||||||
|
deny members of "foo";
|
||||||
|
range 10.0.29.10 10.0.29.230;
|
||||||
|
}
|
||||||
|
}
|
107
dhcpd6.conf
Normal file
107
dhcpd6.conf
Normal file
@ -0,0 +1,107 @@
|
|||||||
|
# Server configuration file example for DHCPv6
|
||||||
|
# From the file used for TAHI tests.
|
||||||
|
|
||||||
|
#
|
||||||
|
# For more iformations about IPv6 addresses, see also:
|
||||||
|
# http://tools.ietf.org/html/rfc4193
|
||||||
|
# http://tools.ietf.org/html/rfc4291
|
||||||
|
# http://www.iana.org/assignments/ipv6-address-space/
|
||||||
|
#
|
||||||
|
# The addresses in the examples bellow are from the:
|
||||||
|
# FC00::/7 Unique Local Unicast [RFC4193]
|
||||||
|
# address space.
|
||||||
|
#
|
||||||
|
# Please allocate own prefix (6to4, tunnel broker) !
|
||||||
|
#
|
||||||
|
|
||||||
|
# IPv6 address valid lifetime
|
||||||
|
# (at the end the address is no longer usable by the client)
|
||||||
|
# (set to 30 days, the usual IPv6 default)
|
||||||
|
default-lease-time 2592000;
|
||||||
|
|
||||||
|
# IPv6 address preferred lifetime
|
||||||
|
# (at the end the address is deprecated, i.e., the client should use
|
||||||
|
# other addresses for new connections)
|
||||||
|
# (set to 7 days, the usual IPv6 default)
|
||||||
|
preferred-lifetime 604800;
|
||||||
|
|
||||||
|
# T1, the delay before Renew
|
||||||
|
# (default is 1/2 preferred lifetime)
|
||||||
|
# (set to 1 hour)
|
||||||
|
option dhcp-renewal-time 3600;
|
||||||
|
|
||||||
|
# T2, the delay before Rebind (if Renews failed)
|
||||||
|
# (default is 3/4 preferred lifetime)
|
||||||
|
# (set to 2 hours)
|
||||||
|
option dhcp-rebinding-time 7200;
|
||||||
|
|
||||||
|
# Enable RFC 5007 support (same than for DHCPv4)
|
||||||
|
allow leasequery;
|
||||||
|
|
||||||
|
# Global definitions for name server address(es) and domain search list
|
||||||
|
option dhcp6.name-servers fc00:501:ffff:100:200:ff:fe00:3f3e;
|
||||||
|
option dhcp6.domain-search "test.example.com","example.com";
|
||||||
|
|
||||||
|
# Set preference to 255 (maximum) in order to avoid waiting for
|
||||||
|
# additional servers when there is only one
|
||||||
|
##option dhcp6.preference 255;
|
||||||
|
|
||||||
|
# Server side command to enable rapid-commit (2 packet exchange)
|
||||||
|
##option dhcp6.rapid-commit;
|
||||||
|
|
||||||
|
# The delay before information-request refresh
|
||||||
|
# (minimum is 10 minutes, maximum one day, default is to not refresh)
|
||||||
|
# (set to 6 hours)
|
||||||
|
option dhcp6.info-refresh-time 21600;
|
||||||
|
|
||||||
|
# Static definition (must be global)
|
||||||
|
host myclient {
|
||||||
|
# The entry is looked up by this
|
||||||
|
host-identifier option
|
||||||
|
dhcp6.client-id 00:01:00:01:00:04:93:e0:00:00:00:00:a2:a2;
|
||||||
|
|
||||||
|
# A fixed address
|
||||||
|
fixed-address6 fc00:501:ffff:100::1234;
|
||||||
|
|
||||||
|
# A fixed prefix
|
||||||
|
fixed-prefix6 fc00:501:ffff:101::/64;
|
||||||
|
|
||||||
|
# Override of the global definitions,
|
||||||
|
# works only when a resource (address or prefix) is assigned
|
||||||
|
option dhcp6.name-servers fc00:501:ffff:100:200:ff:fe00:4f4e;
|
||||||
|
|
||||||
|
# For debug (to see when the entry statements are executed)
|
||||||
|
# (log "sol" when a matching Solicitation is received)
|
||||||
|
##if packet(0,1) = 1 { log(debug,"sol"); }
|
||||||
|
}
|
||||||
|
|
||||||
|
# The subnet where the server is attached
|
||||||
|
# (i.e., the server has an address in this subnet)
|
||||||
|
subnet6 fc00:501:ffff:100::/64 {
|
||||||
|
# Two addresses available to clients
|
||||||
|
# (the third client should get NoAddrsAvail)
|
||||||
|
range6 fc00:501:ffff:100::10 fc00:501:ffff:100::11;
|
||||||
|
|
||||||
|
# Use the whole /64 prefix for temporary addresses
|
||||||
|
# (i.e., direct application of RFC 4941)
|
||||||
|
range6 fc00:501:ffff:100:: temporary;
|
||||||
|
|
||||||
|
# Some /64 prefixes available for Prefix Delegation (RFC 3633)
|
||||||
|
prefix6 fc00:501:ffff:100:: fc00:501:ffff:111:: /64;
|
||||||
|
}
|
||||||
|
|
||||||
|
# A second subnet behind a relay agent
|
||||||
|
subnet6 fc00:501:ffff:101::/64 {
|
||||||
|
range6 fc00:501:ffff:101::10 fc00:501:ffff:101::11;
|
||||||
|
|
||||||
|
# Override of the global definitions,
|
||||||
|
# works only when a resource (address or prefix) is assigned
|
||||||
|
option dhcp6.name-servers fc00:501:ffff:101:200:ff:fe00:3f3e;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
# A third subnet behind a relay agent chain
|
||||||
|
subnet6 fc00:501:ffff:102::/64 {
|
||||||
|
range6 fc00:501:ffff:102::10 fc00:501:ffff:102::11;
|
||||||
|
}
|
||||||
|
|
88
dhcpd6.xml
Normal file
88
dhcpd6.xml
Normal file
@ -0,0 +1,88 @@
|
|||||||
|
<?xml version="1.0"?>
|
||||||
|
<!--
|
||||||
|
Copyright (c) 2006 Novell, Inc. All rights reserved.
|
||||||
|
|
||||||
|
|
||||||
|
Service Description XML Document for dhcpd6.
|
||||||
|
|
||||||
|
This file should be placed in /etc/omc/svcinfo.d
|
||||||
|
|
||||||
|
Note: The name of the service is the name of this file without the .xml
|
||||||
|
file extension.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<serviceDescription version="1.0">
|
||||||
|
|
||||||
|
<!-- Caption for display purposes -->
|
||||||
|
<caption>ISC DHCPv6 4.x Server</caption>
|
||||||
|
|
||||||
|
<!-- Description of this service -->
|
||||||
|
<description>
|
||||||
|
ISC Dynamic Host Configuration Protocol for IPv6 Server
|
||||||
|
</description>
|
||||||
|
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The startCommand tag specifies the command line that will be
|
||||||
|
invoked to start the service. The return code from this command
|
||||||
|
must be as follows:
|
||||||
|
0 - success
|
||||||
|
1 - generic or unspecified error
|
||||||
|
2 - invalid or excess argument(s)
|
||||||
|
3 - unimplemented feature (e.g. "reload")
|
||||||
|
4 - user had insufficient privileges
|
||||||
|
5 - program is not installed
|
||||||
|
6 - program is not configured
|
||||||
|
7 - program is not running
|
||||||
|
-->
|
||||||
|
<startCommand>/etc/init.d/dhcpd6 start</startCommand>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The reStartCommand tag specifies the command line that will be
|
||||||
|
invoked to restart the service. The return code from this command
|
||||||
|
must be as specified in the startCommand tag.
|
||||||
|
-->
|
||||||
|
<reStartCommand>/etc/init.d/dhcpd6 restart</reStartCommand>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The stopCommand tag specifies the command line that will be
|
||||||
|
invoked to stop the service. The return code from this command
|
||||||
|
must be as specified in the startCommand tag.
|
||||||
|
-->
|
||||||
|
<stopCommand>/etc/init.d/dhcpd6 stop</stopCommand>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
The statusCommand specifies the command line that can be run
|
||||||
|
that will report on the status of the service. The return code
|
||||||
|
from this command line should be as follows:
|
||||||
|
0 - service up and running
|
||||||
|
1 - service dead, but /var/run/ pid file exists
|
||||||
|
2 - service dead, but /var/lock/ lock file exists
|
||||||
|
3 - service not running (unused)
|
||||||
|
4 - service status unknown :-(
|
||||||
|
-->
|
||||||
|
<statusCommand>/etc/init.d/dhcpd6 status</statusCommand>
|
||||||
|
<!--
|
||||||
|
The processInformation tag allows the XML Service provider to
|
||||||
|
identify the processes that belong to the service. This allows
|
||||||
|
the ServiceProcess associations to be instrumented.
|
||||||
|
If the process_information tag is not specifed, the will be no
|
||||||
|
ServiceProcess association for the service.
|
||||||
|
-->
|
||||||
|
|
||||||
|
<processInformation>
|
||||||
|
<name>dhcpd6</name>
|
||||||
|
<modulePath>/usr/sbin/dhcpd6</modulePath>
|
||||||
|
</processInformation>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Define the services that this service has a dependency on.
|
||||||
|
There must be a corresponding Service Description XML file
|
||||||
|
for the antecedent service in the /etc/omc/svcinfo.d directory.
|
||||||
|
-->
|
||||||
|
<dependsOn>
|
||||||
|
<serviceName>network</serviceName>
|
||||||
|
</dependsOn>
|
||||||
|
|
||||||
|
|
||||||
|
</serviceDescription>
|
@ -57,6 +57,7 @@ fi
|
|||||||
. /etc/sysconfig/network/ifcfg-"$CONFIG" 2>/dev/null || true
|
. /etc/sysconfig/network/ifcfg-"$CONFIG" 2>/dev/null || true
|
||||||
|
|
||||||
: ${DHCPD_IFUP_RESTART:=auto}
|
: ${DHCPD_IFUP_RESTART:=auto}
|
||||||
|
: ${DHCPD6_IFUP_RESTART:=auto}
|
||||||
|
|
||||||
iface_needs_restart()
|
iface_needs_restart()
|
||||||
{
|
{
|
||||||
@ -65,17 +66,17 @@ iface_needs_restart()
|
|||||||
-f /proc/net/vlan/$1
|
-f /proc/net/vlan/$1
|
||||||
}
|
}
|
||||||
|
|
||||||
case "$0" in
|
dhcpv4_server_restart()
|
||||||
*if-up.d*)
|
{
|
||||||
#
|
#
|
||||||
# don't do anything if we are disabled either
|
# don't do anything if we are disabled either
|
||||||
# in the /etc/sysconfig/dhcpd or per interface
|
# in the /etc/sysconfig/dhcpd or per interface
|
||||||
# in the /etc/sysconfig/network/ifcfg-"$CONFIG"
|
# in the /etc/sysconfig/network/ifcfg-"$CONFIG"
|
||||||
#
|
#
|
||||||
test "$DHCPD_IFUP_RESTART" = no && exit 0
|
test "$DHCPD_IFUP_RESTART" = no && return 0
|
||||||
|
|
||||||
# don't restart for loopback interface
|
# don't restart for loopback interface
|
||||||
case $INTERFACE in (lo) exit 0 ;; esac
|
case $INTERFACE in (lo) return 0 ;; esac
|
||||||
|
|
||||||
restart_needed=$DHCPD_IFUP_RESTART
|
restart_needed=$DHCPD_IFUP_RESTART
|
||||||
if test -n "$DHCPD_INTERFACE" \
|
if test -n "$DHCPD_INTERFACE" \
|
||||||
@ -86,7 +87,7 @@ case "$0" in
|
|||||||
|
|
||||||
# don't restart when _one_ involved
|
# don't restart when _one_ involved
|
||||||
# interface is not available/up yet
|
# interface is not available/up yet
|
||||||
is_iface_up $I || exit 0
|
is_iface_up $I || return 0
|
||||||
|
|
||||||
# check if this interface is involved
|
# check if this interface is involved
|
||||||
if test "$I" = "$INTERFACE" ; then
|
if test "$I" = "$INTERFACE" ; then
|
||||||
@ -102,6 +103,50 @@ case "$0" in
|
|||||||
if test "$restart_needed" = yes ; then
|
if test "$restart_needed" = yes ; then
|
||||||
/etc/init.d/dhcpd try-restart
|
/etc/init.d/dhcpd try-restart
|
||||||
fi
|
fi
|
||||||
|
}
|
||||||
|
dhcpv6_server_restart()
|
||||||
|
{
|
||||||
|
#
|
||||||
|
# don't do anything if we are disabled either
|
||||||
|
# in the /etc/sysconfig/dhcpd or per interface
|
||||||
|
# in the /etc/sysconfig/network/ifcfg-"$CONFIG"
|
||||||
|
#
|
||||||
|
test "$DHCPD6_IFUP_RESTART" = no && return 0
|
||||||
|
|
||||||
|
# don't restart for loopback interface
|
||||||
|
case $INTERFACE in (lo) return 0 ;; esac
|
||||||
|
|
||||||
|
restart_needed=$DHCPD6_IFUP_RESTART
|
||||||
|
if test -n "$DHCPD6_INTERFACE" \
|
||||||
|
-a "$restart_needed" != yes ;
|
||||||
|
then
|
||||||
|
for I in $DHCPD6_INTERFACE ; do
|
||||||
|
test -n "$I" || continue
|
||||||
|
|
||||||
|
# don't restart when _one_ involved
|
||||||
|
# interface is not available/up yet
|
||||||
|
is_iface_up $I || return 0
|
||||||
|
|
||||||
|
# check if this interface is involved
|
||||||
|
if test "$I" = "$INTERFACE" ; then
|
||||||
|
|
||||||
|
# check if a restart is needed
|
||||||
|
if iface_needs_restart $I ; then
|
||||||
|
restart_needed=yes
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$restart_needed" = yes ; then
|
||||||
|
/etc/init.d/dhcpd6 try-restart
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
case "$0" in
|
||||||
|
*if-up.d*)
|
||||||
|
dhcpv4_server_restart
|
||||||
|
dhcpv6_server_restart
|
||||||
;;
|
;;
|
||||||
*if-down.d*)
|
*if-down.d*)
|
||||||
# don't do anything
|
# don't do anything
|
||||||
|
164
rc.dhcpd
164
rc.dhcpd
@ -2,63 +2,70 @@
|
|||||||
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
|
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
|
||||||
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
|
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
|
||||||
# Copyright (c) 2002, 2003 SuSE Linux AG
|
# Copyright (c) 2002, 2003 SuSE Linux AG
|
||||||
|
# Copyright (c) 2004-2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
#
|
#
|
||||||
# Author: Rolf Haberrecker <rolf@suse.de>, 1997, 1998, 1999
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
# Peter Poeml <poeml@suse.de>, 2000, 2001, 2002, 2003
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
#
|
#
|
||||||
# /etc/init.d/dhcpd
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||||
|
# Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
# Author: Rolf Haberrecker <rolf@suse.de>, 1997-1999
|
||||||
|
# Peter Poeml <poeml@suse.de>, 2000-2006
|
||||||
|
# Marius Tomaschewski <mt@suse.de>, 2006-2010
|
||||||
|
#
|
||||||
|
# /etc/init.d/dhcp-server
|
||||||
# and its symbolic link
|
# and its symbolic link
|
||||||
# /usr/sbin/rcdhcpd
|
# /usr/sbin/rcdhcp-server
|
||||||
#
|
#
|
||||||
### BEGIN INIT INFO
|
### BEGIN INIT INFO
|
||||||
# Provides: dhcpd
|
# Provides: dhcp-server
|
||||||
# Required-Start: $network $remote_fs network-remotefs
|
# Required-Start: $remote_fs $network
|
||||||
# Should-Start: $named $syslog $time ldap ndsd
|
# Should-Start: network-remotefs $named $syslog $time ldap ndsd
|
||||||
# Required-Stop: $network $remote_fs network-remotefs
|
# Required-Stop: $remote_fs $network
|
||||||
# Should-Stop: $named $syslog ldap ndsd
|
# Should-Stop: network-remotefs $named $syslog ldap ndsd
|
||||||
# Default-Start: 3 5
|
# Default-Start: 3 5
|
||||||
# Default-Stop: 0 1 2 6
|
# Default-Stop: 0 1 2 6
|
||||||
# Short-Description: DHCP Server
|
# Short-Description: ISC DHCP 4.x Server
|
||||||
# Description: Start DHCP (Dynamic Host Configuration Protocol)
|
# Description: Start ISC DHCP (Dynamic Host Configuration Protocol)
|
||||||
# server. (Note: if configured for failover it
|
# 4.x series server.
|
||||||
|
# (Note: if configured for failover it
|
||||||
# needs to rely on time synchronisation.)
|
# needs to rely on time synchronisation.)
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
|
test -s /etc/sysconfig/dhcpd && . /etc/sysconfig/dhcpd
|
||||||
|
|
||||||
if [ -s /etc/sysconfig/dhcpd ]; then
|
SUPPORTS_CHROOT="yes"
|
||||||
|
SUPPORTS_RUN_AS="yes"
|
||||||
|
SUPPORTS_HUP="no"
|
||||||
|
|
||||||
. /etc/sysconfig/dhcpd
|
DHCPDv_OPT=-4
|
||||||
|
test "$SUPPORTS_CHROOT" = no && DHCPD_RUN_CHROOTED=no
|
||||||
|
test "$SUPPORTS_RUN_AS" = no && DHCPD_RUN_AS=""
|
||||||
|
test "$DHCPD_BINARY" = "/usr/sbin/dhcpd.lpf" -o \
|
||||||
|
"$DHCPD_BINARY" = "/usr/sbin/dhcpd.bsd" && \
|
||||||
|
DHCPD_BINARY=/usr/sbin/dhcpd
|
||||||
|
|
||||||
else
|
DAEMON='ISC DHCPv4 4.x Server'
|
||||||
# pre 8.0
|
|
||||||
|
|
||||||
# Source SuSE config
|
|
||||||
. /etc/rc.config
|
|
||||||
|
|
||||||
test -s /etc/rc.config.d/dhcpd.rc.config && \
|
|
||||||
. /etc/rc.config.d/dhcpd.rc.config
|
|
||||||
|
|
||||||
# Determine the base and follow a runlevel link name.
|
|
||||||
base=${0##*/}
|
|
||||||
link=${base#*[SK][0-9][0-9]}
|
|
||||||
|
|
||||||
# Force execution if not called by a runlevel directory.
|
|
||||||
test $link = $base && START_DHCPD=yes
|
|
||||||
test "$START_DHCPD" = yes || exit 0
|
|
||||||
|
|
||||||
fi
|
|
||||||
|
|
||||||
|
|
||||||
test "$DHCPD_RUN_CHROOTED" = "yes" && CHROOT_PREFIX=/var/lib/dhcp/
|
|
||||||
DAEMON="DHCP server"
|
|
||||||
[ "$DHCPD_BINARY" = /usr/sbin/dhcpd.lpf ] && DHCPD_BINARY=/usr/sbin/dhcpd
|
|
||||||
DAEMON_BIN=${DHCPD_BINARY:=/usr/sbin/dhcpd}
|
DAEMON_BIN=${DHCPD_BINARY:=/usr/sbin/dhcpd}
|
||||||
DAEMON_CONF=/etc/dhcpd.conf
|
DAEMON_CONF=/etc/dhcpd.conf
|
||||||
|
DAEMON_STATE=/var/lib/dhcp
|
||||||
|
DAEMON_LEASES=dhcpd.leases
|
||||||
DAEMON_PIDFILE=/var/run/dhcpd.pid
|
DAEMON_PIDFILE=/var/run/dhcpd.pid
|
||||||
STARTPROC_LOGFILE=/var/log/rc.dhcpd.log
|
STARTPROC_LOGFILE=/var/log/rc.dhcpd.log
|
||||||
SUPPORTS_HUP="no"
|
|
||||||
LDAP_CONF=/etc/openldap/ldap.conf
|
LDAP_CONF=/etc/openldap/ldap.conf
|
||||||
|
|
||||||
|
test "$DHCPD_RUN_CHROOTED" = "yes" && \
|
||||||
|
CHROOT_PREFIX="$DAEMON_STATE" || CHROOT_PREFIX=''
|
||||||
|
|
||||||
# Shell functions sourced from /etc/rc.status:
|
# Shell functions sourced from /etc/rc.status:
|
||||||
# rc_check check and set local and overall rc status
|
# rc_check check and set local and overall rc status
|
||||||
# rc_status check and set local and overall rc status
|
# rc_status check and set local and overall rc status
|
||||||
@ -88,11 +95,15 @@ rc_reset
|
|||||||
# with force-reload (in case signalling is not supported) are
|
# with force-reload (in case signalling is not supported) are
|
||||||
# considered a success.
|
# considered a success.
|
||||||
|
|
||||||
if ! [ -x $DAEMON_BIN ]; then
|
if ! [ -x "$DAEMON_BIN" ]; then
|
||||||
|
if [ "$1" = "stop" ]; then exit 0; fi
|
||||||
echo >&2 "$0: \"$DAEMON_BIN\" is not an executable file. Exiting."
|
echo >&2 "$0: \"$DAEMON_BIN\" is not an executable file. Exiting."
|
||||||
rc_failed 1
|
exit 5
|
||||||
rc_status -v1
|
fi
|
||||||
rc_exit
|
if ! [ -r "$DAEMON_CONF" ] ; then
|
||||||
|
if [ "$1" = "stop" ]; then exit 0; fi
|
||||||
|
echo >&2 "$0: \"$DAEMON_CONF\" config file missed. Exiting."
|
||||||
|
exit 6
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove empty pid files to avoid disturbing warnings by checkproc/killproc
|
# remove empty pid files to avoid disturbing warnings by checkproc/killproc
|
||||||
@ -117,7 +128,9 @@ case "$1" in
|
|||||||
## If the interfaces are not set, skip starting of dhcpd
|
## If the interfaces are not set, skip starting of dhcpd
|
||||||
## and return with "program not configured"
|
## and return with "program not configured"
|
||||||
if [ -z "$DHCPD_INTERFACE" ]; then
|
if [ -z "$DHCPD_INTERFACE" ]; then
|
||||||
echo -n "... set DHCPD_INTERFACE in /etc/sysconfig/dhcpd"
|
var="DHCPD_INTERFACE"
|
||||||
|
case $DHCPDv_OPT in -6) var=DHCPD6_INTERFACE ;; esac
|
||||||
|
echo -n "... set $var in /etc/sysconfig/dhcpd"
|
||||||
# Tell the user this has skipped
|
# Tell the user this has skipped
|
||||||
rc_status -s
|
rc_status -s
|
||||||
# service is not configured
|
# service is not configured
|
||||||
@ -128,7 +141,7 @@ case "$1" in
|
|||||||
DHCPD_INTERFACE=""
|
DHCPD_INTERFACE=""
|
||||||
fi
|
fi
|
||||||
|
|
||||||
jail=/var/lib/dhcp; leases=dhcpd.leases
|
jail=${CHROOT_PREFIX:-${DAEMON_STATE}}; leases=$DAEMON_LEASES
|
||||||
if ! [ -e $jail/db/$leases ]; then
|
if ! [ -e $jail/db/$leases ]; then
|
||||||
# until 9.0, the lease file was in /var/lib/dhcp and part of the package
|
# until 9.0, the lease file was in /var/lib/dhcp and part of the package
|
||||||
if test -e $jail/$leases -a '!' -L $jail/$leases; then
|
if test -e $jail/$leases -a '!' -L $jail/$leases; then
|
||||||
@ -150,7 +163,7 @@ case "$1" in
|
|||||||
if test "$DHCPD_RUN_CHROOTED" = "yes" ; then
|
if test "$DHCPD_RUN_CHROOTED" = "yes" ; then
|
||||||
## copy the conf file to the chroot jail (dhcpd has to be restarted anyway,
|
## copy the conf file to the chroot jail (dhcpd has to be restarted anyway,
|
||||||
## when it has changed) and change path to leases file
|
## when it has changed) and change path to leases file
|
||||||
for i in $DAEMON_CONF $DHCPD_CONF_INCLUDE_FILES $LDAP_CONF; do
|
for i in $DAEMON_CONF $DHCPD_CONF_INCLUDE_FILES $LDAP_CONF /etc /dev; do
|
||||||
if test -d "${i}" ; then
|
if test -d "${i}" ; then
|
||||||
test -d "$CHROOT_PREFIX/${i}" || \
|
test -d "$CHROOT_PREFIX/${i}" || \
|
||||||
mkdir -p "$CHROOT_PREFIX/${i}"
|
mkdir -p "$CHROOT_PREFIX/${i}"
|
||||||
@ -165,18 +178,19 @@ case "$1" in
|
|||||||
cp -aL "$i" "${CHROOT_PREFIX}/${i%/*}/" &>/dev/null \
|
cp -aL "$i" "${CHROOT_PREFIX}/${i%/*}/" &>/dev/null \
|
||||||
|| { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; }
|
|| { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; }
|
||||||
done
|
done
|
||||||
libdir=$(basename $(echo /var/lib/dhcp/lib*))
|
libdir=$(basename $(echo ${CHROOT_PREFIX}/lib*))
|
||||||
if test -x /usr/bin/ldd ; then
|
if test -x /usr/bin/ldd ; then
|
||||||
get_ldd_deps()
|
get_ldd_deps()
|
||||||
{
|
{
|
||||||
ldd_wl="\/${libdir}\/lib"
|
ldd_wl="\/${libdir}\/lib"
|
||||||
ldd_bl="\/${libdir}\/libc\."
|
ldd_bl="\/${libdir}\/libc\."
|
||||||
|
/usr/bin/ldd "$1" | \
|
||||||
while read -sr a b c d ; do
|
while read -sr a b c d ; do
|
||||||
[ -n "$c" ] || continue
|
[ -n "$c" ] || continue
|
||||||
[[ $c =~ $ldd_wl ]] || continue
|
[[ $c =~ $ldd_wl ]] || continue
|
||||||
[[ $c =~ $ldd_bl ]] && continue
|
[[ $c =~ $ldd_bl ]] && continue
|
||||||
echo $c
|
echo $c
|
||||||
done < <(/usr/bin/ldd "$1")
|
done
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
get_ldd_deps() { :; }
|
get_ldd_deps() { :; }
|
||||||
@ -191,11 +205,16 @@ case "$1" in
|
|||||||
done | sort -u`
|
done | sort -u`
|
||||||
for i in $cplibs ; do
|
for i in $cplibs ; do
|
||||||
if [ -s "$i" ]; then
|
if [ -s "$i" ]; then
|
||||||
cp -pL "$i" "/var/lib/dhcp/$libdir/" \
|
cp -pL "$i" "${CHROOT_PREFIX}/$libdir/" \
|
||||||
|| { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; }
|
|| { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; }
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
DHCPD_ARGS="-chroot $CHROOT_PREFIX -lf /db/dhcpd.leases"
|
|
||||||
|
# mount /proc into the chroot; the server fails if unable to read /proc/net/{dev,if_inet6}
|
||||||
|
mkdir -p ${CHROOT_PREFIX}/proc
|
||||||
|
mount -t proc -o ro proc ${CHROOT_PREFIX}/proc 2>/dev/null
|
||||||
|
|
||||||
|
DHCPD_ARGS="-chroot $CHROOT_PREFIX -lf /db/$DAEMON_LEASES"
|
||||||
|
|
||||||
## If there is a pid file containing a pid, the machine might have crashed. pid files in
|
## If there is a pid file containing a pid, the machine might have crashed. pid files in
|
||||||
## /var/run are always cleaned up at boot time, but this is not the case for the pid file in
|
## /var/run are always cleaned up at boot time, but this is not the case for the pid file in
|
||||||
@ -203,26 +222,32 @@ case "$1" in
|
|||||||
## incidentally contains the pid of a running process. If this process is not a 'dhcpd',
|
## incidentally contains the pid of a running process. If this process is not a 'dhcpd',
|
||||||
## we remove the pid. (dhcpd itself only checks whether the pid is alive or not.)
|
## we remove the pid. (dhcpd itself only checks whether the pid is alive or not.)
|
||||||
if test -e $CHROOT_PREFIX/$DAEMON_PIDFILE -a -s $CHROOT_PREFIX/$DAEMON_PIDFILE; then
|
if test -e $CHROOT_PREFIX/$DAEMON_PIDFILE -a -s $CHROOT_PREFIX/$DAEMON_PIDFILE; then
|
||||||
i=$(<$CHROOT_PREFIX/$DAEMON_PIDFILE)
|
p=$(<$CHROOT_PREFIX/$DAEMON_PIDFILE)
|
||||||
if pidof dhcpd &>/dev/null; then
|
if test -n "$p" && grep -qE "^${DAEMON_BIN}" "/proc/$p/cmdline" ; then
|
||||||
echo -n "(already running) "
|
echo -n '(already running) '
|
||||||
else
|
else
|
||||||
rm $CHROOT_PREFIX/$DAEMON_PIDFILE
|
rm $CHROOT_PREFIX/$DAEMON_PIDFILE
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
DHCPD_ARGS="-lf ${DAEMON_STATE}/db/$DAEMON_LEASES"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -n "$DHCPD_RUN_AS" ]; then
|
if [ -n "$DHCPD_RUN_AS" ]; then
|
||||||
DHCPD_RUN_AS_GROUP="$(getent group $(getent passwd $DHCPD_RUN_AS | cut -d: -f4) | cut -d: -f1)"
|
DHCPD_RUN_AS_GROUP="$(getent group $(getent passwd $DHCPD_RUN_AS | cut -d: -f4) | cut -d: -f1)"
|
||||||
DHCPD_ARGS="$DHCPD_ARGS -user $DHCPD_RUN_AS -group $DHCPD_RUN_AS_GROUP"
|
DHCPD_ARGS="$DHCPD_ARGS -user $DHCPD_RUN_AS -group $DHCPD_RUN_AS_GROUP"
|
||||||
|
|
||||||
|
if test "$DHCPD_RUN_CHROOTED" = "yes" ; then
|
||||||
|
chown "${DHCPD_RUN_AS}:${DHCPD_RUN_AS_GROUP}" \
|
||||||
|
"$CHROOT_PREFIX/${DAEMON_PIDFILE%/*}"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
## check syntax with -t (output to log file) and start only when the syntax is okay
|
## check syntax with -t (output to log file) and start only when the syntax is okay
|
||||||
rm -f $STARTPROC_LOGFILE # start log
|
rm -f $STARTPROC_LOGFILE # start log
|
||||||
error=0
|
error=0
|
||||||
if ! $DAEMON_BIN -t -cf $CHROOT_PREFIX/$DAEMON_CONF > $STARTPROC_LOGFILE 2>&1 ; then
|
if ! $DAEMON_BIN $DHCPDv_OPT -t -cf $CHROOT_PREFIX/$DAEMON_CONF -pf $DAEMON_PIDFILE > $STARTPROC_LOGFILE 2>&1 ; then
|
||||||
error=1
|
error=1
|
||||||
else
|
else
|
||||||
## Start daemon. If this fails the return value is set appropriate.
|
## Start daemon. If this fails the return value is set appropriate.
|
||||||
@ -230,9 +255,9 @@ case "$1" in
|
|||||||
## to match the LSB spec.
|
## to match the LSB spec.
|
||||||
|
|
||||||
test "$2" = "-v" && echo -en \
|
test "$2" = "-v" && echo -en \
|
||||||
"\nexecuting '$DAEMON_BIN $DHCPD_ARGS $DHCPD_OTHER_ARGS $DHCPD_INTERFACE'"
|
"\nexecuting '$DAEMON_BIN $DHCPDv_OPT -cf $DAEMON_CONF -pf $DAEMON_PIDFILE $DHCPD_ARGS $DHCPD_OTHER_ARGS $DHCPD_INTERFACE'"
|
||||||
|
|
||||||
$DAEMON_BIN $DHCPD_ARGS $DHCPD_OTHER_ARGS $DHCPD_INTERFACE &> $STARTPROC_LOGFILE
|
$DAEMON_BIN $DHCPDv_OPT -cf $DAEMON_CONF -pf $DAEMON_PIDFILE $DHCPD_ARGS $DHCPD_OTHER_ARGS $DHCPD_INTERFACE &> $STARTPROC_LOGFILE
|
||||||
ret=$?
|
ret=$?
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -259,9 +284,10 @@ case "$1" in
|
|||||||
kill $(<$CHROOT_PREFIX/$DAEMON_PIDFILE) 2>/dev/null
|
kill $(<$CHROOT_PREFIX/$DAEMON_PIDFILE) 2>/dev/null
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# remove libraries from the chroot jail, just so they are not left over
|
# umount proc and remove libraries from the chroot jail,
|
||||||
# if the server is deinstalled
|
# so they are not left over if the server is deinstalled
|
||||||
if [ "$DHCPD_RUN_CHROOTED" = yes ]; then
|
if [ "$DHCPD_RUN_CHROOTED" = yes -a -n "$CHROOT_PREFIX" ]; then
|
||||||
|
umount ${CHROOT_PREFIX}/proc 2>/dev/null
|
||||||
rm -f $CHROOT_PREFIX/lib*/*
|
rm -f $CHROOT_PREFIX/lib*/*
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -300,8 +326,8 @@ case "$1" in
|
|||||||
echo -n "Reload service $DAEMON"
|
echo -n "Reload service $DAEMON"
|
||||||
|
|
||||||
if [ "$SUPPORTS_HUP" = "yes" ]; then
|
if [ "$SUPPORTS_HUP" = "yes" ]; then
|
||||||
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
|
killproc -p $CHROOT_PREFIX/$DAEMON_PIDFILE -HUP $DAEMON_BIN
|
||||||
#touch $DAEMON_PIDFILE
|
#touch $CHROOT_PREFIX/$DAEMON_PIDFILE
|
||||||
rc_status -v
|
rc_status -v
|
||||||
else
|
else
|
||||||
$0 stop && sleep 3 && $0 start
|
$0 stop && sleep 3 && $0 start
|
||||||
@ -315,8 +341,8 @@ case "$1" in
|
|||||||
echo -n "Reload service $DAEMON"
|
echo -n "Reload service $DAEMON"
|
||||||
if [ "$SUPPORTS_HUP" = "yes" ]; then
|
if [ "$SUPPORTS_HUP" = "yes" ]; then
|
||||||
# If it supports signalling:
|
# If it supports signalling:
|
||||||
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
|
killproc -p $CHROOT_PREFIX/$DAEMON_PIDFILE -HUP $DAEMON_BIN
|
||||||
#touch $DAEMON_PIDFILE
|
#touch $CHROOT_PREFIX/$DAEMON_PIDFILE
|
||||||
rc_status -v
|
rc_status -v
|
||||||
else
|
else
|
||||||
## Otherwise if it does not support reload:
|
## Otherwise if it does not support reload:
|
||||||
@ -354,10 +380,10 @@ case "$1" in
|
|||||||
|
|
||||||
## this nice bit is from Edwin Groothuis:
|
## this nice bit is from Edwin Groothuis:
|
||||||
## check syntax (quiet)
|
## check syntax (quiet)
|
||||||
$DAEMON_BIN -q -t -cf $DAEMON_CONF
|
$DAEMON_BIN $DHCPDv_OPT -q -t -cf $DAEMON_CONF
|
||||||
if ! [ $? -eq 0 ]; then
|
if ! [ $? -eq 0 ]; then
|
||||||
## check syntax (verbose)
|
## check syntax (verbose)
|
||||||
$DAEMON_BIN -t -cf $DAEMON_CONF
|
$DAEMON_BIN $DHCPDv_OPT -t -cf $DAEMON_CONF
|
||||||
echo -e '\nConfig is NOT okay\n'
|
echo -e '\nConfig is NOT okay\n'
|
||||||
else
|
else
|
||||||
echo 'Config is okay. Hope you also specified existent network devices ;) '
|
echo 'Config is okay. Hope you also specified existent network devices ;) '
|
||||||
@ -365,10 +391,10 @@ case "$1" in
|
|||||||
## in v3, lease file checking is also implemented
|
## in v3, lease file checking is also implemented
|
||||||
if [ $DAEMON_BIN != "/usr/sbin/dhcpd-2" ]; then
|
if [ $DAEMON_BIN != "/usr/sbin/dhcpd-2" ]; then
|
||||||
## check leases file (quiet)
|
## check leases file (quiet)
|
||||||
$DAEMON_BIN -q -T -cf $DAEMON_CONF -lf /var/lib/dhcp/db/dhcpd.leases
|
$DAEMON_BIN $DHCPDv_OPT -q -T -cf $DAEMON_CONF -lf ${DAEMON_STATE}/db/$DAEMON_LEASES
|
||||||
if ! [ $? -eq 0 ]; then
|
if ! [ $? -eq 0 ]; then
|
||||||
## check leases file (verbose)
|
## check leases file (verbose)
|
||||||
$DAEMON_BIN -T -cf $DAEMON_CONF -lf /var/lib/dhcp/db/dhcpd.leases
|
$DAEMON_BIN $DHCPDv_OPT -T -cf $DAEMON_CONF -lf ${DAEMON_STATE}/db/$DAEMON_LEASES
|
||||||
echo -e '\nLease file is NOT okay'
|
echo -e '\nLease file is NOT okay'
|
||||||
else
|
else
|
||||||
echo 'Lease file is okay'
|
echo 'Lease file is okay'
|
||||||
|
413
rc.dhcpd6
Normal file
413
rc.dhcpd6
Normal file
@ -0,0 +1,413 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
|
||||||
|
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
|
||||||
|
# Copyright (c) 2002, 2003 SuSE Linux AG
|
||||||
|
# Copyright (c) 2004-2008 SUSE LINUX Products GmbH, Nuernberg, Germany.
|
||||||
|
#
|
||||||
|
# This program is free software; you can redistribute it and/or modify it under
|
||||||
|
# the terms of the GNU General Public License as published by the Free Software
|
||||||
|
# Foundation; either version 2 of the License, or (at your option) any later
|
||||||
|
# version.
|
||||||
|
#
|
||||||
|
# This program is distributed in the hope that it will be useful, but WITHOUT
|
||||||
|
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
|
||||||
|
# FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
|
||||||
|
# details.
|
||||||
|
#
|
||||||
|
# You should have received a copy of the GNU General Public License along with
|
||||||
|
# this program; if not, write to the Free Software Foundation, Inc., 59 Temple
|
||||||
|
# Place, Suite 330, Boston, MA 02111-1307 USA
|
||||||
|
#
|
||||||
|
# Author: Rolf Haberrecker <rolf@suse.de>, 1997-1999
|
||||||
|
# Peter Poeml <poeml@suse.de>, 2000-2006
|
||||||
|
# Marius Tomaschewski <mt@suse.de>, 2006-2010
|
||||||
|
#
|
||||||
|
# /etc/init.d/dhcp-server
|
||||||
|
# and its symbolic link
|
||||||
|
# /usr/sbin/rcdhcp-server
|
||||||
|
#
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: dhcp6-server
|
||||||
|
# Required-Start: $remote_fs $network
|
||||||
|
# Should-Start: network-remotefs $named $syslog $time ldap ndsd
|
||||||
|
# Required-Stop: $remote_fs $network
|
||||||
|
# Should-Stop: network-remotefs $named $syslog ldap ndsd
|
||||||
|
# Default-Start: 3 5
|
||||||
|
# Default-Stop: 0 1 2 6
|
||||||
|
# Short-Description: ISC DHCP 4.x Server
|
||||||
|
# Description: Start ISC DHCP (Dynamic Host Configuration Protocol)
|
||||||
|
# 4.x series server.
|
||||||
|
# (Note: if configured for failover it
|
||||||
|
# needs to rely on time synchronisation.)
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
test -s /etc/sysconfig/dhcpd && . /etc/sysconfig/dhcpd
|
||||||
|
|
||||||
|
SUPPORTS_CHROOT="yes"
|
||||||
|
SUPPORTS_RUN_AS="yes"
|
||||||
|
SUPPORTS_HUP="no"
|
||||||
|
|
||||||
|
DHCPDv_OPT=-6
|
||||||
|
DHCPD_RUN_CHROOTED=$DHCPD6_RUN_CHROOTED
|
||||||
|
DHCPD_RUN_AS=$DHCPD6_RUN_AS
|
||||||
|
DHCPD_BINARY=$DHCPD6_BINARY
|
||||||
|
DHCPD_INTERFACE=$DHCPD6_INTERFACE
|
||||||
|
DHCPD_CONF_INCLUDE_FILES=$DHCPD6_CONF_INCLUDE_FILES
|
||||||
|
DHCPD_OTHER_ARGS=$DHCPD6_OTHER_ARGS
|
||||||
|
|
||||||
|
test "$SUPPORTS_CHROOT" = no && DHCPD_RUN_CHROOTED=no
|
||||||
|
test "$SUPPORTS_RUN_AS" = no && DHCPD_RUN_AS=""
|
||||||
|
|
||||||
|
DAEMON='ISC DHCPv6 4.x Server'
|
||||||
|
DAEMON_BIN=${DHCPD_BINARY:=/usr/sbin/dhcpd6}
|
||||||
|
DAEMON_CONF=/etc/dhcpd6.conf
|
||||||
|
DAEMON_STATE=/var/lib/dhcp6
|
||||||
|
DAEMON_LEASES=dhcpd6.leases
|
||||||
|
DAEMON_PIDFILE=/var/run/dhcpd6.pid
|
||||||
|
STARTPROC_LOGFILE=/var/log/rc.dhcpd6.log
|
||||||
|
LDAP_CONF=
|
||||||
|
|
||||||
|
test "$DHCPD_RUN_CHROOTED" = "yes" && \
|
||||||
|
CHROOT_PREFIX="$DAEMON_STATE" || CHROOT_PREFIX=''
|
||||||
|
|
||||||
|
# Shell functions sourced from /etc/rc.status:
|
||||||
|
# rc_check check and set local and overall rc status
|
||||||
|
# rc_status check and set local and overall rc status
|
||||||
|
# rc_status -v ditto but be verbose in local rc status
|
||||||
|
# rc_status -v -r ditto and clear the local rc status
|
||||||
|
# rc_failed set local and overall rc status to failed
|
||||||
|
# rc_failed <num> set local and overall rc status to <num><num>
|
||||||
|
# rc_reset clear local rc status (overall remains)
|
||||||
|
# rc_exit exit appropriate to overall rc status
|
||||||
|
. /etc/rc.status
|
||||||
|
|
||||||
|
# First reset status of this service
|
||||||
|
rc_reset
|
||||||
|
|
||||||
|
# Return values acc. to LSB for all commands but status:
|
||||||
|
# 0 - success
|
||||||
|
# 1 - generic or unspecified error
|
||||||
|
# 2 - invalid or excess argument(s)
|
||||||
|
# 3 - unimplemented feature (e.g. "reload")
|
||||||
|
# 4 - insufficient privilege
|
||||||
|
# 5 - program is not installed
|
||||||
|
# 6 - program is not configured
|
||||||
|
# 7 - program is not running
|
||||||
|
#
|
||||||
|
# Note that starting an already running service, stopping
|
||||||
|
# or restarting a not-running service as well as the restart
|
||||||
|
# with force-reload (in case signalling is not supported) are
|
||||||
|
# considered a success.
|
||||||
|
|
||||||
|
if ! [ -x "$DAEMON_BIN" ]; then
|
||||||
|
if [ "$1" = "stop" ]; then exit 0; fi
|
||||||
|
echo >&2 "$0: \"$DAEMON_BIN\" is not an executable file. Exiting."
|
||||||
|
exit 5
|
||||||
|
fi
|
||||||
|
if ! [ -r "$DAEMON_CONF" ] ; then
|
||||||
|
if [ "$1" = "stop" ]; then exit 0; fi
|
||||||
|
echo >&2 "$0: \"$DAEMON_CONF\" config file missed. Exiting."
|
||||||
|
exit 6
|
||||||
|
fi
|
||||||
|
|
||||||
|
# remove empty pid files to avoid disturbing warnings by checkproc/killproc
|
||||||
|
# (these can occur if dhcpd does not start correctly)
|
||||||
|
test -e $DAEMON_PIDFILE && ! test -s $DAEMON_PIDFILE && rm $DAEMON_PIDFILE
|
||||||
|
test -e $CHROOT_PREFIX/$DAEMON_PIDFILE && ! test -s $CHROOT_PREFIX/$DAEMON_PIDFILE && rm $CHROOT_PREFIX/$DAEMON_PIDFILE
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting $DAEMON "
|
||||||
|
|
||||||
|
## If there is no conf file, skip starting of dhcpd
|
||||||
|
## and return with "program not configured"
|
||||||
|
if ! [ -f $DAEMON_CONF ]; then
|
||||||
|
echo -n "... no configuration file found";
|
||||||
|
# Tell the user this has skipped
|
||||||
|
rc_status -s
|
||||||
|
# service is not configured
|
||||||
|
exit 6;
|
||||||
|
fi
|
||||||
|
|
||||||
|
## If the interfaces are not set, skip starting of dhcpd
|
||||||
|
## and return with "program not configured"
|
||||||
|
if [ -z "$DHCPD_INTERFACE" ]; then
|
||||||
|
var="DHCPD_INTERFACE"
|
||||||
|
case $DHCPDv_OPT in -6) var=DHCPD6_INTERFACE ;; esac
|
||||||
|
echo -n "... set $var in /etc/sysconfig/dhcpd"
|
||||||
|
# Tell the user this has skipped
|
||||||
|
rc_status -s
|
||||||
|
# service is not configured
|
||||||
|
exit 6;
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ "$DHCPD_INTERFACE" = "ANY" ]; then
|
||||||
|
DHCPD_INTERFACE=""
|
||||||
|
fi
|
||||||
|
|
||||||
|
jail=${CHROOT_PREFIX:-${DAEMON_STATE}}; leases=$DAEMON_LEASES
|
||||||
|
if ! [ -e $jail/db/$leases ]; then
|
||||||
|
# until 9.0, the lease file was in /var/lib/dhcp and part of the package
|
||||||
|
if test -e $jail/$leases -a '!' -L $jail/$leases; then
|
||||||
|
# this is the case where the %post script runs _before_ the old package is
|
||||||
|
# removed (i.e., dhcpd.leases has not renamed to .rpmsave yet)
|
||||||
|
mv $jail/$leases $jail/db/$leases && \
|
||||||
|
ln -s db/$leases $jail/
|
||||||
|
elif test -e $jail/$leases.rpmsave; then
|
||||||
|
# this is what's left when the package is already gone.
|
||||||
|
mv $jail/$leases.rpmsave $jail/db/$leases && \
|
||||||
|
ln -s db/$leases $jail/
|
||||||
|
else
|
||||||
|
# fresh installation:
|
||||||
|
# a lease file must be present. the server won't start without
|
||||||
|
touch $jail/db/$leases
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
if test "$DHCPD_RUN_CHROOTED" = "yes" ; then
|
||||||
|
## copy the conf file to the chroot jail (dhcpd has to be restarted anyway,
|
||||||
|
## when it has changed) and change path to leases file
|
||||||
|
for i in $DAEMON_CONF $DHCPD_CONF_INCLUDE_FILES $LDAP_CONF /etc /dev; do
|
||||||
|
if test -d "${i}" ; then
|
||||||
|
test -d "$CHROOT_PREFIX/${i}" || \
|
||||||
|
mkdir -p "$CHROOT_PREFIX/${i}"
|
||||||
|
elif test -e "${i}" ; then
|
||||||
|
test -d "$CHROOT_PREFIX/${i%/*}" || \
|
||||||
|
mkdir -p "$CHROOT_PREFIX/${i%/*}"
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
rm -f $CHROOT_PREFIX/dev/urandom
|
||||||
|
for i in $DAEMON_CONF $DHCPD_CONF_INCLUDE_FILES $LDAP_CONF /etc/{gai.conf,nsswitch.conf,resolv.conf,host.conf,hosts,localtime} /dev/urandom; do
|
||||||
|
if ! test -e "$i"; then continue; fi # neither of them is absolutely necessary
|
||||||
|
cp -aL "$i" "${CHROOT_PREFIX}/${i%/*}/" &>/dev/null \
|
||||||
|
|| { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; }
|
||||||
|
done
|
||||||
|
libdir=$(basename $(echo ${CHROOT_PREFIX}/lib*))
|
||||||
|
if test -x /usr/bin/ldd ; then
|
||||||
|
get_ldd_deps()
|
||||||
|
{
|
||||||
|
ldd_wl="\/${libdir}\/lib"
|
||||||
|
ldd_bl="\/${libdir}\/libc\."
|
||||||
|
/usr/bin/ldd "$1" | \
|
||||||
|
while read -sr a b c d ; do
|
||||||
|
[ -n "$c" ] || continue
|
||||||
|
[[ $c =~ $ldd_wl ]] || continue
|
||||||
|
[[ $c =~ $ldd_bl ]] && continue
|
||||||
|
echo $c
|
||||||
|
done
|
||||||
|
}
|
||||||
|
else
|
||||||
|
get_ldd_deps() { :; }
|
||||||
|
fi
|
||||||
|
cplibs=`for i in /$libdir/{libresolv.so.*,libnss_*.so.*} \
|
||||||
|
/$libdir/{libpthread.so.0,libdl.so.2} ;
|
||||||
|
do
|
||||||
|
if [ -s "$i" ] ; then
|
||||||
|
echo "$i"
|
||||||
|
get_ldd_deps "$i"
|
||||||
|
fi
|
||||||
|
done | sort -u`
|
||||||
|
for i in $cplibs ; do
|
||||||
|
if [ -s "$i" ]; then
|
||||||
|
cp -pL "$i" "${CHROOT_PREFIX}/$libdir/" \
|
||||||
|
|| { echo "...$0:$LINENO: could not copy $i to chroot jail"; rc_failed; rc_status -v1; exit 6; }
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
# mount /proc into the chroot; the server fails if unable to read /proc/net/{dev,if_inet6}
|
||||||
|
mkdir -p ${CHROOT_PREFIX}/proc
|
||||||
|
mount -t proc -o ro proc ${CHROOT_PREFIX}/proc 2>/dev/null
|
||||||
|
|
||||||
|
DHCPD_ARGS="-chroot $CHROOT_PREFIX -lf /db/$DAEMON_LEASES"
|
||||||
|
|
||||||
|
## If there is a pid file containing a pid, the machine might have crashed. pid files in
|
||||||
|
## /var/run are always cleaned up at boot time, but this is not the case for the pid file in
|
||||||
|
## the chroot jail. Therefore, and old pid file may exist. This is only a problem if it
|
||||||
|
## incidentally contains the pid of a running process. If this process is not a 'dhcpd',
|
||||||
|
## we remove the pid. (dhcpd itself only checks whether the pid is alive or not.)
|
||||||
|
if test -e $CHROOT_PREFIX/$DAEMON_PIDFILE -a -s $CHROOT_PREFIX/$DAEMON_PIDFILE; then
|
||||||
|
p=$(<$CHROOT_PREFIX/$DAEMON_PIDFILE)
|
||||||
|
if test -n "$p" && grep -qE "^${DAEMON_BIN}" "/proc/$p/cmdline" ; then
|
||||||
|
echo -n '(already running) '
|
||||||
|
else
|
||||||
|
rm $CHROOT_PREFIX/$DAEMON_PIDFILE
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
DHCPD_ARGS="-lf ${DAEMON_STATE}/db/$DAEMON_LEASES"
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ -n "$DHCPD_RUN_AS" ]; then
|
||||||
|
DHCPD_RUN_AS_GROUP="$(getent group $(getent passwd $DHCPD_RUN_AS | cut -d: -f4) | cut -d: -f1)"
|
||||||
|
DHCPD_ARGS="$DHCPD_ARGS -user $DHCPD_RUN_AS -group $DHCPD_RUN_AS_GROUP"
|
||||||
|
|
||||||
|
if test "$DHCPD_RUN_CHROOTED" = "yes" ; then
|
||||||
|
chown "${DHCPD_RUN_AS}:${DHCPD_RUN_AS_GROUP}" \
|
||||||
|
"$CHROOT_PREFIX/${DAEMON_PIDFILE%/*}"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## check syntax with -t (output to log file) and start only when the syntax is okay
|
||||||
|
rm -f $STARTPROC_LOGFILE # start log
|
||||||
|
error=0
|
||||||
|
if ! $DAEMON_BIN $DHCPDv_OPT -t -cf $CHROOT_PREFIX/$DAEMON_CONF -pf $DAEMON_PIDFILE > $STARTPROC_LOGFILE 2>&1 ; then
|
||||||
|
error=1
|
||||||
|
else
|
||||||
|
## Start daemon. If this fails the return value is set appropriate.
|
||||||
|
## The init script should return 0, even if service is already running,
|
||||||
|
## to match the LSB spec.
|
||||||
|
|
||||||
|
test "$2" = "-v" && echo -en \
|
||||||
|
"\nexecuting '$DAEMON_BIN $DHCPDv_OPT -cf $DAEMON_CONF -pf $DAEMON_PIDFILE $DHCPD_ARGS $DHCPD_OTHER_ARGS $DHCPD_INTERFACE'"
|
||||||
|
|
||||||
|
$DAEMON_BIN $DHCPDv_OPT -cf $DAEMON_CONF -pf $DAEMON_PIDFILE $DHCPD_ARGS $DHCPD_OTHER_ARGS $DHCPD_INTERFACE &> $STARTPROC_LOGFILE
|
||||||
|
ret=$?
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $error -gt 0 -o ${ret:-0} -gt 0 ]; then
|
||||||
|
cat $STARTPROC_LOGFILE
|
||||||
|
## set status to failed
|
||||||
|
rc_failed
|
||||||
|
else
|
||||||
|
[ "$DHCPD_RUN_CHROOTED" = "yes" ] && echo -n "[chroot]" || :
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remember status and be verbose
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n "Shutting down $DAEMON "
|
||||||
|
|
||||||
|
## Stop daemon with killproc(8) and if this fails
|
||||||
|
## set echo the echo return value.
|
||||||
|
|
||||||
|
killproc -p $CHROOT_PREFIX/$DAEMON_PIDFILE -TERM $DAEMON_BIN
|
||||||
|
ret=$?
|
||||||
|
if test -s $CHROOT_PREFIX/$DAEMON_PIDFILE; then
|
||||||
|
kill $(<$CHROOT_PREFIX/$DAEMON_PIDFILE) 2>/dev/null
|
||||||
|
fi
|
||||||
|
|
||||||
|
# umount proc and remove libraries from the chroot jail,
|
||||||
|
# so they are not left over if the server is deinstalled
|
||||||
|
if [ "$DHCPD_RUN_CHROOTED" = yes -a -n "$CHROOT_PREFIX" ]; then
|
||||||
|
umount ${CHROOT_PREFIX}/proc 2>/dev/null
|
||||||
|
rm -f $CHROOT_PREFIX/lib*/*
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remember status and be verbose
|
||||||
|
rc_failed $ret
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
try-restart)
|
||||||
|
## Do a restart only if the service was active before.
|
||||||
|
## Note: try-restart is now part of LSB (as of 1.9).
|
||||||
|
## RH has a similar command named condrestart.
|
||||||
|
$0 status
|
||||||
|
if test $? = 0; then
|
||||||
|
$0 restart
|
||||||
|
else
|
||||||
|
rc_reset # Not running is not a failure.
|
||||||
|
fi
|
||||||
|
# Remember status and be quiet
|
||||||
|
rc_status
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
## Stop the service and regardless of whether it was
|
||||||
|
## running or not, start it again.
|
||||||
|
$0 stop
|
||||||
|
sleep 3
|
||||||
|
$0 start
|
||||||
|
|
||||||
|
# Remember status and be quiet
|
||||||
|
rc_status
|
||||||
|
;;
|
||||||
|
force-reload)
|
||||||
|
## Signal the daemon to reload its config. Most daemons
|
||||||
|
## do this on signal 1 (SIGHUP).
|
||||||
|
## If it does not support it, restart.
|
||||||
|
|
||||||
|
echo -n "Reload service $DAEMON"
|
||||||
|
|
||||||
|
if [ "$SUPPORTS_HUP" = "yes" ]; then
|
||||||
|
killproc -p $CHROOT_PREFIX/$DAEMON_PIDFILE -HUP $DAEMON_BIN
|
||||||
|
#touch $CHROOT_PREFIX/$DAEMON_PIDFILE
|
||||||
|
rc_status -v
|
||||||
|
else
|
||||||
|
$0 stop && sleep 3 && $0 start
|
||||||
|
rc_status
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
## Like force-reload, but if daemon does not support
|
||||||
|
## signalling, do nothing (!)
|
||||||
|
|
||||||
|
echo -n "Reload service $DAEMON"
|
||||||
|
if [ "$SUPPORTS_HUP" = "yes" ]; then
|
||||||
|
# If it supports signalling:
|
||||||
|
killproc -p $CHROOT_PREFIX/$DAEMON_PIDFILE -HUP $DAEMON_BIN
|
||||||
|
#touch $CHROOT_PREFIX/$DAEMON_PIDFILE
|
||||||
|
rc_status -v
|
||||||
|
else
|
||||||
|
## Otherwise if it does not support reload:
|
||||||
|
rc_failed 3
|
||||||
|
rc_status -v
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
echo -n "Checking for $DAEMON: "
|
||||||
|
## Check status with checkproc(8), if process is running
|
||||||
|
## checkproc will return with exit status 0.
|
||||||
|
|
||||||
|
# Status has a slightly different for the status command:
|
||||||
|
# 0 - service running
|
||||||
|
# 1 - service dead, but /var/run/ pid file exists
|
||||||
|
# 2 - service dead, but /var/lock/ lock file exists
|
||||||
|
# 3 - service not running
|
||||||
|
|
||||||
|
# NOTE: checkproc returns LSB compliant status values.
|
||||||
|
checkproc -p $CHROOT_PREFIX/$DAEMON_PIDFILE $DAEMON_BIN
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
probe)
|
||||||
|
## Optional: Probe for the necessity of a reload,
|
||||||
|
## give out the argument which is required for a reload.
|
||||||
|
|
||||||
|
rc=0
|
||||||
|
for i in /etc/sysconfig/dhcpd $DAEMON_CONF $DHCPD_CONF_INCLUDE_FILES; do
|
||||||
|
test $i -nt $CHROOT_PREFIX/$DAEMON_PIDFILE && rc=1
|
||||||
|
done
|
||||||
|
test $rc = 1 && echo restart
|
||||||
|
;;
|
||||||
|
check-syntax|syntax-check)
|
||||||
|
echo "Checking syntax of $DAEMON_CONF: "
|
||||||
|
|
||||||
|
## this nice bit is from Edwin Groothuis:
|
||||||
|
## check syntax (quiet)
|
||||||
|
$DAEMON_BIN $DHCPDv_OPT -q -t -cf $DAEMON_CONF
|
||||||
|
if ! [ $? -eq 0 ]; then
|
||||||
|
## check syntax (verbose)
|
||||||
|
$DAEMON_BIN $DHCPDv_OPT -t -cf $DAEMON_CONF
|
||||||
|
echo -e '\nConfig is NOT okay\n'
|
||||||
|
else
|
||||||
|
echo 'Config is okay. Hope you also specified existent network devices ;) '
|
||||||
|
|
||||||
|
## in v3, lease file checking is also implemented
|
||||||
|
if [ $DAEMON_BIN != "/usr/sbin/dhcpd-2" ]; then
|
||||||
|
## check leases file (quiet)
|
||||||
|
$DAEMON_BIN $DHCPDv_OPT -q -T -cf $DAEMON_CONF -lf ${DAEMON_STATE}/db/$DAEMON_LEASES
|
||||||
|
if ! [ $? -eq 0 ]; then
|
||||||
|
## check leases file (verbose)
|
||||||
|
$DAEMON_BIN $DHCPDv_OPT -T -cf $DAEMON_CONF -lf ${DAEMON_STATE}/db/$DAEMON_LEASES
|
||||||
|
echo -e '\nLease file is NOT okay'
|
||||||
|
else
|
||||||
|
echo 'Lease file is okay'
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe|check-syntax} [-v]"
|
||||||
|
exit 1
|
||||||
|
esac
|
||||||
|
rc_exit
|
20
rc.dhcrelay
20
rc.dhcrelay
@ -2,8 +2,10 @@
|
|||||||
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
|
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
|
||||||
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
|
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
|
||||||
# Copyright (c) 2002 SuSE Linux AG
|
# Copyright (c) 2002 SuSE Linux AG
|
||||||
|
# Copyright (c) 2003-2010 SUSE LINUX Products GmbH
|
||||||
#
|
#
|
||||||
# Author: Peter Poeml <poeml@suse.de>, 2001
|
# Author: Peter Poeml <poeml@suse.de>, 2001
|
||||||
|
# Marius Tomaschewski <mt@suse.de>, 2010
|
||||||
#
|
#
|
||||||
# /etc/init.d/dhcrelay
|
# /etc/init.d/dhcrelay
|
||||||
# and its symbolic link
|
# and its symbolic link
|
||||||
@ -18,23 +20,23 @@
|
|||||||
# Default-Start: 3 5
|
# Default-Start: 3 5
|
||||||
# Default-Stop: 0 1 2 6
|
# Default-Stop: 0 1 2 6
|
||||||
# Short-Description: DHCP Relay
|
# Short-Description: DHCP Relay
|
||||||
# Description: Start DHCP (Dynamic Host Configuration Protocol)
|
# Description: Start DHCP (Dynamic Host Configuration Protocol)
|
||||||
# gateway, relaying DHCP requests from one
|
# relay agent, forwarding DHCP requests from one
|
||||||
# physical network segment to another.
|
# physical network segment to another.
|
||||||
### END INIT INFO
|
### END INIT INFO
|
||||||
|
|
||||||
|
DAEMON="ISC DHCPv4 relay agent"
|
||||||
test -s /etc/sysconfig/dhcrelay && \
|
|
||||||
. /etc/sysconfig/dhcrelay
|
|
||||||
|
|
||||||
DAEMON="dhcp relay agent"
|
|
||||||
DAEMON_BIN=/usr/sbin/dhcrelay
|
DAEMON_BIN=/usr/sbin/dhcrelay
|
||||||
DAEMON_CONF=/etc/sysconfig/dhcrelay
|
DAEMON_CONF=/etc/sysconfig/dhcrelay
|
||||||
DAEMON_PIDFILE=/var/run/dhcrelay.pid
|
DAEMON_PIDFILE=/var/run/dhcrelay.pid
|
||||||
STARTPROC_LOGFILE=/var/log/rc.dhcrelay.log
|
STARTPROC_LOGFILE=/var/log/rc.dhcrelay.log
|
||||||
SUPPORTS_HUP="no"
|
SUPPORTS_HUP="no"
|
||||||
|
|
||||||
test -x $DAEMON_BIN || exit 5
|
test -s "$DAEMON_CONF" && "$DAEMON_CONF"
|
||||||
|
test -x $DAEMON_BIN || {
|
||||||
|
echo >&2 "$0: \"$DAEMON_BIN\" is not executable."
|
||||||
|
test "x$1" = xstop && exit 0 || exit 5
|
||||||
|
}
|
||||||
|
|
||||||
# Shell functions sourced from /etc/rc.status:
|
# Shell functions sourced from /etc/rc.status:
|
||||||
# rc_check check and set local and overall rc status
|
# rc_check check and set local and overall rc status
|
||||||
|
220
rc.dhcrelay6
Normal file
220
rc.dhcrelay6
Normal file
@ -0,0 +1,220 @@
|
|||||||
|
#! /bin/sh
|
||||||
|
# Copyright (c) 1996, 1997, 1998 S.u.S.E. GmbH
|
||||||
|
# Copyright (c) 1998, 1999, 2000, 2001 SuSE GmbH
|
||||||
|
# Copyright (c) 2002 SuSE Linux AG
|
||||||
|
# Copyright (c) 2003-2010 SUSE LINUX Products GmbH
|
||||||
|
#
|
||||||
|
# Author: Peter Poeml <poeml@suse.de>, 2001
|
||||||
|
# Marius Tomaschewski <mt@suse.de>, 2010
|
||||||
|
#
|
||||||
|
# /etc/init.d/dhcrelay6
|
||||||
|
# and its symbolic link
|
||||||
|
# /usr/sbin/rcdhcrelay6
|
||||||
|
#
|
||||||
|
### BEGIN INIT INFO
|
||||||
|
# Provides: dhcrelay6
|
||||||
|
# Required-Start: $network $remote_fs network-remotefs
|
||||||
|
# Should-Start: $named $syslog $time
|
||||||
|
# Required-Stop: $network $remote_fs network-remotefs
|
||||||
|
# Should-Stop: $named $syslog
|
||||||
|
# Default-Start: 3 5
|
||||||
|
# Default-Stop: 0 1 2 6
|
||||||
|
# Short-Description: DHCPv6 Relay
|
||||||
|
# Description: Start DHCPv6 (Dynamic Host Configuration Protocol)
|
||||||
|
# relay agent, forwarding DHCP requests from one
|
||||||
|
# physical network segment to another.
|
||||||
|
### END INIT INFO
|
||||||
|
|
||||||
|
|
||||||
|
DAEMON="ISC DHCPv6 relay agent"
|
||||||
|
DAEMON_BIN=/usr/sbin/dhcrelay6
|
||||||
|
DAEMON_CONF=/etc/sysconfig/dhcrelay
|
||||||
|
DAEMON_PIDFILE=/var/run/dhcrelay6.pid
|
||||||
|
STARTPROC_LOGFILE=/var/log/rc.dhcrelay6.log
|
||||||
|
SUPPORTS_HUP="no"
|
||||||
|
|
||||||
|
test -s "$DAEMON_CONF" && "$DAEMON_CONF"
|
||||||
|
test -x $DAEMON_BIN || {
|
||||||
|
echo >&2 "$0: \"$DAEMON_BIN\" is not executable."
|
||||||
|
test "x$1" = xstop && exit 0 || exit 5
|
||||||
|
}
|
||||||
|
|
||||||
|
# Shell functions sourced from /etc/rc.status:
|
||||||
|
# rc_check check and set local and overall rc status
|
||||||
|
# rc_status check and set local and overall rc status
|
||||||
|
# rc_status -v ditto but be verbose in local rc status
|
||||||
|
# rc_status -v -r ditto and clear the local rc status
|
||||||
|
# rc_failed set local and overall rc status to failed
|
||||||
|
# rc_failed <num> set local and overall rc status to <num><num>
|
||||||
|
# rc_reset clear local rc status (overall remains)
|
||||||
|
# rc_exit exit appropriate to overall rc status
|
||||||
|
. /etc/rc.status
|
||||||
|
|
||||||
|
# First reset status of this service
|
||||||
|
rc_reset
|
||||||
|
|
||||||
|
# Return values acc. to LSB for all commands but status:
|
||||||
|
# 0 - success
|
||||||
|
# 1 - generic or unspecified error
|
||||||
|
# 2 - invalid or excess argument(s)
|
||||||
|
# 3 - unimplemented feature (e.g. "reload")
|
||||||
|
# 4 - insufficient privilege
|
||||||
|
# 5 - program is not installed
|
||||||
|
# 6 - program is not configured
|
||||||
|
# 7 - program is not running
|
||||||
|
#
|
||||||
|
# Note that starting an already running service, stopping
|
||||||
|
# or restarting a not-running service as well as the restart
|
||||||
|
# with force-reload (in case signalling is not supported) are
|
||||||
|
# considered a success.
|
||||||
|
|
||||||
|
case "$1" in
|
||||||
|
start)
|
||||||
|
echo -n "Starting $DAEMON"
|
||||||
|
checkproc $DAEMON_BIN && { echo -n "... already running"; rc_status -v; exit 0; }
|
||||||
|
|
||||||
|
for l in $DHCRELAY6_LOWER_INTERFACES ; do
|
||||||
|
test x"$l" = x && continue
|
||||||
|
DHCRELAY6_LOWER_INTERFACES_ARGS="$DHCRELAY6_LOWER_INTERFACES_ARGS -l $l"
|
||||||
|
done
|
||||||
|
for u in $DHCRELAY6_UPPER_INTERFACES ; do
|
||||||
|
test x"$u" = x && continue
|
||||||
|
DHCRELAY6_UPPER_INTERFACES_ARGS="$DHCRELAY6_UPPER_INTERFACES_ARGS -u $u"
|
||||||
|
done
|
||||||
|
|
||||||
|
## If interfaces or servers are not set, skip starting of dhcrelay
|
||||||
|
## and return with "program not configured"
|
||||||
|
if [ "x$DHCRELAY6_LOWER_INTERFACES_ARGS" = x -o \
|
||||||
|
"x$DHCRELAY6_UPPER_INTERFACES_ARGS" = x ]; then
|
||||||
|
# Tell the user this has skipped
|
||||||
|
rc_status -s
|
||||||
|
# service is not configured
|
||||||
|
exit 6;
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
## Start daemon with startproc(8). If this fails
|
||||||
|
## the echo return value is set appropriate.
|
||||||
|
|
||||||
|
# startproc should return 0, even if service is
|
||||||
|
# already running to match LSB spec.
|
||||||
|
test "$2" = "-v" && echo -en \
|
||||||
|
"\nexecuting '$DAEMON_BIN $DHCRELAY6_OPTIONS $DHCRELAY6_LOWER_INTERFACES_ARGS $DHCRELAY6_UPPER_INTERFACES_ARGS'"
|
||||||
|
startproc -q -l $STARTPROC_LOGFILE $DAEMON_BIN $DHCRELAY6_OPTIONS $DHCRELAY6_LOWER_INTERFACES_ARGS $DHCRELAY6_UPPER_INTERFACES_ARGS
|
||||||
|
rc=$?
|
||||||
|
if ! [ $rc -eq 0 ]; then
|
||||||
|
if [ $link = $base ] ; then
|
||||||
|
## be quiet
|
||||||
|
cat $STARTPROC_LOGFILE
|
||||||
|
else
|
||||||
|
## be verbose
|
||||||
|
echo -e -n " please see $STARTPROC_LOGFILE for details ";
|
||||||
|
fi
|
||||||
|
## set status to failed
|
||||||
|
rc_failed
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Remember status and be verbose
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
stop)
|
||||||
|
echo -n "Shutting down $DAEMON"
|
||||||
|
## Stop daemon with killproc(8) and if this fails
|
||||||
|
## set echo the echo return value.
|
||||||
|
|
||||||
|
killproc -p $DAEMON_PIDFILE -TERM $DAEMON_BIN
|
||||||
|
|
||||||
|
# Remember status and be verbose
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
try-restart)
|
||||||
|
## Do a restart only if the service was active before.
|
||||||
|
## Note: try-restart is now part of LSB (as of 1.9).
|
||||||
|
## RH has a similar command named condrestart.
|
||||||
|
$0 status
|
||||||
|
if test $? = 0; then
|
||||||
|
$0 restart
|
||||||
|
else
|
||||||
|
rc_reset # Not running is not a failure.
|
||||||
|
fi
|
||||||
|
# Remember status and be quiet
|
||||||
|
rc_status
|
||||||
|
;;
|
||||||
|
restart)
|
||||||
|
## Stop the service and regardless of whether it was
|
||||||
|
## running or not, start it again.
|
||||||
|
$0 stop
|
||||||
|
sleep 1
|
||||||
|
$0 start
|
||||||
|
|
||||||
|
# Remember status and be quiet
|
||||||
|
rc_status
|
||||||
|
;;
|
||||||
|
force-reload)
|
||||||
|
## Signal the daemon to reload its config. Most daemons
|
||||||
|
## do this on signal 1 (SIGHUP).
|
||||||
|
## If it does not support it, restart.
|
||||||
|
|
||||||
|
$0 stop && sleep 1 && $0 start
|
||||||
|
rc_status
|
||||||
|
|
||||||
|
echo -n "Reload service $DAEMON"
|
||||||
|
|
||||||
|
if "$SUPPORTS_HUP" = "yes" ; then
|
||||||
|
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
|
||||||
|
#touch $DAEMON_PIDFILE
|
||||||
|
rc_status -v
|
||||||
|
else
|
||||||
|
$0 stop && $0 start
|
||||||
|
rc_status
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
reload)
|
||||||
|
## Like force-reload, but if daemon does not support
|
||||||
|
## signalling, do nothing (!)
|
||||||
|
|
||||||
|
if "$SUPPORTS_HUP" = "yes" ; then
|
||||||
|
# If it supports signalling:
|
||||||
|
echo -n "Reload service $DAEMON"
|
||||||
|
killproc -p $DAEMON_PIDFILE -HUP $DAEMON_BIN
|
||||||
|
#touch $DAEMON_PIDFILE
|
||||||
|
rc_status -v
|
||||||
|
else
|
||||||
|
## Otherwise if it does not support reload:
|
||||||
|
rc_failed 3
|
||||||
|
rc_status -v
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
status)
|
||||||
|
echo -n "Checking for dhcp relay agent: "
|
||||||
|
## Check status with checkproc(8), if process is running
|
||||||
|
## checkproc will return with exit status 0.
|
||||||
|
|
||||||
|
# Status has a slightly different for the status command:
|
||||||
|
# 0 - service running
|
||||||
|
# 1 - service dead, but /var/run/ pid file exists
|
||||||
|
# 2 - service dead, but /var/lock/ lock file exists
|
||||||
|
# 3 - service not running
|
||||||
|
|
||||||
|
# NOTE: checkproc returns LSB compliant status values.
|
||||||
|
checkproc -p $DAEMON_PIDFILE $DAEMON_BIN
|
||||||
|
rc_status -v
|
||||||
|
;;
|
||||||
|
probe)
|
||||||
|
## Optional: Probe for the necessity of a reload,
|
||||||
|
## give out the argument which is required for a reload.
|
||||||
|
|
||||||
|
if [ "$DAEMON_CONF" -nt "$DAEMON_PIDFILE" ]; then
|
||||||
|
if [ "$SUPPORTS_HUP" = "yes" ]; then
|
||||||
|
echo reload
|
||||||
|
else
|
||||||
|
echo restart
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload|probe} [-v]"
|
||||||
|
exit 1
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
rc_exit
|
112
sysconfig.dhcpd
112
sysconfig.dhcpd
@ -1,24 +1,38 @@
|
|||||||
## Path: Network/DHCP/DHCP server
|
## Path: Network/DHCP/DHCP server
|
||||||
## Description: DHCP server settings
|
## Description: DHCPv4 server settings
|
||||||
## Type: string
|
## Type: string
|
||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: dhcpd
|
## ServiceRestart: dhcpd
|
||||||
#
|
#
|
||||||
# Interface(s) for the DHCP server to listen on.
|
# Interface(s) for the DHCPv4 server to listen on.
|
||||||
#
|
#
|
||||||
# A special keyword is ANY, it will cause dhcpd to autodetect available
|
# A special keyword is ANY, it will cause dhcpd to autodetect available
|
||||||
# interfaces.
|
# interfaces.
|
||||||
#
|
#
|
||||||
# Examples: DHCPD_INTERFACE="eth0"
|
# Examples: DHCPD_INTERFACE="eth0 eth1 eth2"
|
||||||
# DHCPD_INTERFACE="eth0 eth1 eth2 tr0 wlan0"
|
|
||||||
# DHCPD_INTERFACE="internal0 internal1"
|
|
||||||
# DHCPD_INTERFACE="ANY"
|
# DHCPD_INTERFACE="ANY"
|
||||||
#
|
#
|
||||||
DHCPD_INTERFACE=""
|
DHCPD_INTERFACE=""
|
||||||
|
|
||||||
|
## Path: Network/DHCP/DHCP server
|
||||||
|
## Description: DHCPv6 server settings
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: dhcpd6
|
||||||
|
#
|
||||||
|
# Interface(s) for the DHCPv6 server to listen on.
|
||||||
|
#
|
||||||
|
# A special keyword is ANY, it will cause dhcpd to autodetect available
|
||||||
|
# interfaces.
|
||||||
|
#
|
||||||
|
# Examples: DHCPD6_INTERFACE="eth0 eth1 eth2"
|
||||||
|
# DHCPD6_INTERFACE="ANY"
|
||||||
|
#
|
||||||
|
DHCPD6_INTERFACE=""
|
||||||
|
|
||||||
## Type: list(yes,no,auto,)
|
## Type: list(yes,no,auto,)
|
||||||
## Default:
|
## Default:
|
||||||
## Description: Restart dhcp server when interface goes up (again)
|
## Description: Restart dhcpv4 server when interface goes up (again)
|
||||||
#
|
#
|
||||||
# When the dhcp server is listening on a virtual interface, e.g. bridge,
|
# When the dhcp server is listening on a virtual interface, e.g. bridge,
|
||||||
# bonding or vlan, and this interface gets deleted and recreated during
|
# bonding or vlan, and this interface gets deleted and recreated during
|
||||||
@ -38,6 +52,28 @@ DHCPD_INTERFACE=""
|
|||||||
#
|
#
|
||||||
DHCPD_IFUP_RESTART=""
|
DHCPD_IFUP_RESTART=""
|
||||||
|
|
||||||
|
## Type: list(yes,no,auto,)
|
||||||
|
## Default:
|
||||||
|
## Description: Restart dhcpv6 server when interface goes up (again)
|
||||||
|
#
|
||||||
|
# When the dhcp server is listening on a virtual interface, e.g. bridge,
|
||||||
|
# bonding or vlan, and this interface gets deleted and recreated during
|
||||||
|
# a network restart, dhcpd will stop answering requests on this interface
|
||||||
|
# and needs a restart as well.
|
||||||
|
# Begining with SLE-10 SP3, we install an if-up.d post script (see ifup(8)
|
||||||
|
# and also ifservices(5)), enabled in auto mode by default. This variable
|
||||||
|
# can be used to force or avoid the dhcp server restart:
|
||||||
|
#
|
||||||
|
# no: do not restart dhcpd
|
||||||
|
# yes: force a dhcp server restart
|
||||||
|
# auto: (default) restart for virtual interfaces (bond,bridge,vlan) when
|
||||||
|
# all interfaces used in DHCPD_INTERFACE variable are up as well.
|
||||||
|
#
|
||||||
|
# Except of this global setting, the variable can be specified per interface
|
||||||
|
# in the interface configurations (/etc/sysconfig/network/ifcfg-$name).
|
||||||
|
#
|
||||||
|
DHCPD6_IFUP_RESTART=""
|
||||||
|
|
||||||
## Type: yesno
|
## Type: yesno
|
||||||
## Default: yes
|
## Default: yes
|
||||||
## ServiceRestart: dhcpd
|
## ServiceRestart: dhcpd
|
||||||
@ -57,6 +93,25 @@ DHCPD_IFUP_RESTART=""
|
|||||||
#
|
#
|
||||||
DHCPD_RUN_CHROOTED="yes"
|
DHCPD_RUN_CHROOTED="yes"
|
||||||
|
|
||||||
|
## Type: yesno
|
||||||
|
## Default: yes
|
||||||
|
## ServiceRestart: dhcpd6
|
||||||
|
#
|
||||||
|
# Shall the DHCP server dhcpd run in a chroot jail (/var/lib/dhcp)?
|
||||||
|
#
|
||||||
|
# Each time you start dhcpd with the init script, /etc/dhcpd.conf will
|
||||||
|
# be copied to /var/lib/dhcp/etc/.
|
||||||
|
#
|
||||||
|
# Some files that are important for hostname to IP address resolution
|
||||||
|
# (/etc/{gai.conf,nsswitch.conf,resolv.conf,host.conf,hosts,localtime},
|
||||||
|
# /lib/lib{resolv.so.*,libnss_*.so.*,libpthread.so.0,libdl.so.2}) will
|
||||||
|
# also be copied to the chroot jail by the init script when you start
|
||||||
|
# it (less than 1MB altogether).
|
||||||
|
#
|
||||||
|
# The pid file will be in /var/lib/dhcp/var/run/dhcpd.pid.
|
||||||
|
#
|
||||||
|
DHCPD6_RUN_CHROOTED="yes"
|
||||||
|
|
||||||
## Type: string
|
## Type: string
|
||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: dhcpd
|
## ServiceRestart: dhcpd
|
||||||
@ -73,6 +128,22 @@ DHCPD_RUN_CHROOTED="yes"
|
|||||||
#
|
#
|
||||||
DHCPD_CONF_INCLUDE_FILES=""
|
DHCPD_CONF_INCLUDE_FILES=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: dhcpd6
|
||||||
|
#
|
||||||
|
# Since version 3, dhcpd.conf can contain include statements.
|
||||||
|
# If you enter the names of any include files here, _all_ conf
|
||||||
|
# files will be copied to $chroot/etc/, when dhcpd is started in the
|
||||||
|
# chroot jail. (/etc/dhcpd.conf is always copied.)
|
||||||
|
#
|
||||||
|
# For your convenience, you can also specify entire directories, like
|
||||||
|
# "/etc/dhcpd.conf.d".
|
||||||
|
#
|
||||||
|
# Example: "/etc/dhcpd.conf.shared /etc/dhcpd.conf.bootp-clients"
|
||||||
|
#
|
||||||
|
DHCPD6_CONF_INCLUDE_FILES=""
|
||||||
|
|
||||||
## Type: string
|
## Type: string
|
||||||
## Default: "dhcpd"
|
## Default: "dhcpd"
|
||||||
## ServiceRestart: dhcpd
|
## ServiceRestart: dhcpd
|
||||||
@ -82,6 +153,15 @@ DHCPD_CONF_INCLUDE_FILES=""
|
|||||||
#
|
#
|
||||||
DHCPD_RUN_AS="dhcpd"
|
DHCPD_RUN_AS="dhcpd"
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: "dhcpd"
|
||||||
|
## ServiceRestart: dhcpd6
|
||||||
|
#
|
||||||
|
# Leave empty or enter "root" to let dhcpd run as root.
|
||||||
|
# Enter "dhcpd" to run dhcpd as user 'dhcpd'.
|
||||||
|
#
|
||||||
|
DHCPD6_RUN_AS="dhcpd"
|
||||||
|
|
||||||
## Type: string
|
## Type: string
|
||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: dhcpd
|
## ServiceRestart: dhcpd
|
||||||
@ -91,6 +171,15 @@ DHCPD_RUN_AS="dhcpd"
|
|||||||
#
|
#
|
||||||
DHCPD_OTHER_ARGS=""
|
DHCPD_OTHER_ARGS=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: dhcpd6
|
||||||
|
#
|
||||||
|
# Other arguments that you want dhcpd to be started with
|
||||||
|
# (e.g. "-p 1234" for a non-standard port to listen on)
|
||||||
|
#
|
||||||
|
DHCPD6_OTHER_ARGS=""
|
||||||
|
|
||||||
## Type: string
|
## Type: string
|
||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: dhcpd
|
## ServiceRestart: dhcpd
|
||||||
@ -102,3 +191,14 @@ DHCPD_OTHER_ARGS=""
|
|||||||
#
|
#
|
||||||
DHCPD_BINARY=""
|
DHCPD_BINARY=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: dhcpd6
|
||||||
|
#
|
||||||
|
# You may specify another dhcpd binary to be run.
|
||||||
|
# The full path needs to be specified.
|
||||||
|
#
|
||||||
|
# If empty, the default applies.
|
||||||
|
#
|
||||||
|
DHCPD6_BINARY=""
|
||||||
|
|
||||||
|
@ -4,11 +4,9 @@
|
|||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: dhcrelay
|
## ServiceRestart: dhcrelay
|
||||||
#
|
#
|
||||||
# Interface(s) for DHCP relay agent to listen on
|
# Interface(s) for DHCPv4 relay agent to listen on
|
||||||
#
|
#
|
||||||
# Examples: DHCPD_INTERFACE="eth0"
|
# Example: DHCPD_INTERFACE="eth0 eth1 eth2 wlan0"
|
||||||
# DHCPD_INTERFACE="eth0 eth1 eth2 tr0 wlan0"
|
|
||||||
# DHCPD_INTERFACE="internal0 internal1"
|
|
||||||
#
|
#
|
||||||
DHCRELAY_INTERFACES=""
|
DHCRELAY_INTERFACES=""
|
||||||
|
|
||||||
@ -16,7 +14,7 @@ DHCRELAY_INTERFACES=""
|
|||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: dhcrelay
|
## ServiceRestart: dhcrelay
|
||||||
#
|
#
|
||||||
# DHCP servers to be used by DHCP relay agent
|
# DHCPv4 servers to be used by DHCPv4 relay agent
|
||||||
# (separated by spaces, e.g. "192.168.0.11 191.168.0.12")
|
# (separated by spaces, e.g. "192.168.0.11 191.168.0.12")
|
||||||
#
|
#
|
||||||
DHCRELAY_SERVERS=""
|
DHCRELAY_SERVERS=""
|
||||||
@ -25,8 +23,37 @@ DHCRELAY_SERVERS=""
|
|||||||
## Default: ""
|
## Default: ""
|
||||||
## ServiceRestart: dhcrelay
|
## ServiceRestart: dhcrelay
|
||||||
#
|
#
|
||||||
# Additional options
|
# Additional DHCPv4 relay start options
|
||||||
# Example: "-c 8"
|
# Example: "-c 8"
|
||||||
#
|
#
|
||||||
DHCRELAY_OPTIONS=""
|
DHCRELAY_OPTIONS=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: dhcrelay6
|
||||||
|
#
|
||||||
|
# Specifies the ``lower'' network interface for DHCPv6 relay mode
|
||||||
|
# separated by spaces.
|
||||||
|
# The format of the lower interface is: "[address%]ifname[#index]".
|
||||||
|
#
|
||||||
|
DHCRELAY6_LOWER_INTERFACES_ARGS=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: dhcrelay6
|
||||||
|
#
|
||||||
|
# Specifies the ``upper'' network interface for DHCPv6 relay mode
|
||||||
|
# separated by spaces.
|
||||||
|
# The format of the upper interface is "[address%]ifname".
|
||||||
|
#
|
||||||
|
DHCRELAY6_UPPER_INTERFACES_ARGS=""
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: ""
|
||||||
|
## ServiceRestart: dhcrelay6
|
||||||
|
#
|
||||||
|
# Additional DHCPv6 relay start options
|
||||||
|
# Example: "-c 8 -I"
|
||||||
|
#
|
||||||
|
DHCRELAY6_OPTIONS=""
|
||||||
|
|
||||||
|
@ -3,10 +3,24 @@
|
|||||||
## ServiceRestart: syslog
|
## ServiceRestart: syslog
|
||||||
#
|
#
|
||||||
# The filename mentioned here will be added with the "-a ..." option as
|
# The filename mentioned here will be added with the "-a ..." option as
|
||||||
# additional socket via SYSLOGD_PARAMS when syslogd is started.
|
# additional socket via SYSLOGD_PARAMS when syslogd is started or used
|
||||||
|
# to generate an include file for another syslog daemons.
|
||||||
#
|
#
|
||||||
# This additional socket is needed in case that syslogd is restarted. Otherwise
|
# This additional socket is needed in case that syslogd is restarted.
|
||||||
# a chrooted dhcpd won't be able to continue logging.
|
# Otherwise a chrooted dhcpd won't be able to continue logging.
|
||||||
#
|
#
|
||||||
SYSLOGD_ADDITIONAL_SOCKET_DHCP="/var/lib/dhcp/dev/log"
|
SYSLOGD_ADDITIONAL_SOCKET_DHCP="/var/lib/dhcp/dev/log"
|
||||||
|
|
||||||
|
## Type: string
|
||||||
|
## Default: "/var/lib/dhcp6/dev/log"
|
||||||
|
## ServiceRestart: syslog
|
||||||
|
#
|
||||||
|
# The filename mentioned here will be added with the "-a ..." option as
|
||||||
|
# additional socket via SYSLOGD_PARAMS when syslogd is started or used
|
||||||
|
# to generate an include file for another syslog daemons.
|
||||||
|
#
|
||||||
|
# This additional socket is needed in case that syslogd is restarted.
|
||||||
|
# Otherwise a chrooted dhcpd won't be able to continue logging.
|
||||||
|
#
|
||||||
|
SYSLOGD_ADDITIONAL_SOCKET_DHCP6="/var/lib/dhcp6/dev/log"
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user