diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-03-16 20:31:15 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2004-03-16 20:31:15 +0000 |
commit | b77059fee230166d718075c75aefc81e483dfe5b (patch) | |
tree | fc6fe8ade1c97ac875e64603da3c6e22730e0d76 /net/isc-dhcp31-server/files/isc-dhcpd.sh.sample | |
parent | Remove Xft. This port has been renamed libXft. (diff) |
Mega-update from maintainer:
isc-dhcp3-client/pkg-message
updated
isc-dhcp3-devel/pkg-plist
updated from PR#61620
isc-dhcp3-relay/pkg-message
rewritten to reflect rcNG change
isc-dhcp3-relay/pkg-plist
etc/rc.isc-dhcrelay.conf deleted
etc/rc.d/isc-dhcrelay.sh.sample renamed to etc/rc.d/isc-dhcrelay.sh
isc-dhcp3-server/Makefile
PORTREVISION bumped
USE_RC_SUBR added
*_SUB added
pre-everything added (WITHOUT_INTERFACE_POLLING cond added)
patch-scripts and patch-pkgmessage (! -devel cond) updated
patch-site-conf and patch-rc-scripts added
install-startup-files now install etc/rc.d/isc-dhcpd.sh
instead of etc/rc.d/isc-dhcpd.sh.sample
display-message updated (! -devel cond)
isc-dhcp3-server/pkg-message
rewritten to reflect rcNG change
isc-dhcp3-server/pkg-plist
etc/rc.isc-dhcpd.conf deleted
etc/rc.d/isc-dhcpd.sh.sample renamed to etc/rc.d/isc-dhcpd.sh
isc-dhcp3-server/files/isc-dhcpd.sh.sample
isc-dhcp3-server/files/isc-dhcrelay.sh.sample
both converted to rcNG
isc-dhcp3-server/files/patch-freebsd
synced w/ -current
isc-dhcp3-server/files/patch-site.conf
CLIENT_PATH added
CFLAGS synced w/ -current
isc-dhcp3-server/patch-client::clparse.c
isc-dhcp3-server/patch-client::dhclient.8
new files synced w/ -current
isc-dhcp3-server/patch-client::dhclient.c
new file synced w/ -current (-DENABLE_POLLING_MODE)
isc-dhcp3-server/patch-client::dhclient.conf
new file
isc-dhcp3-server/patch-common::dhcp-options.5
new file synced w/ -current
isc-dhcp3-server/patch-common::discover.c
new file from PR#61011
isc-dhcp3-server/patch-common::dispatch.c
new file synced w/ -current (-DENABLE_POLLING_MODE)
isc-dhcp3-server/files/patch-common::parse.c
fix time_t issues on little-endian 64-bit platforms
isc-dhcp3-server/patch-dst::Makefile.dist
new file from PR#61620
isc-dhcp3-server/patch-includes::cf::freebsd.h
new file synced w/ -current (-DRESCUE unused right now)
isc-dhcp3-server/patch-includes::dhcpd.h
new file synced w/ -current (-DENABLE_POLLING_MODE)
isc-dhcp3-server/files/rc.isc-dhcpd.conf.sample
isc-dhcp3-server/files/rc.isc-dhcrelay.conf.sample
deleted files
PR: 57943, 61011, 61620
Submitted by: sec@42.org, andy@fud.org.nz, kaa@in-line.ru, des, ru
Notes
Notes:
svn path=/head/; revision=104204
Diffstat (limited to 'net/isc-dhcp31-server/files/isc-dhcpd.sh.sample')
-rw-r--r-- | net/isc-dhcp31-server/files/isc-dhcpd.sh.sample | 98 |
1 files changed, 34 insertions, 64 deletions
diff --git a/net/isc-dhcp31-server/files/isc-dhcpd.sh.sample b/net/isc-dhcp31-server/files/isc-dhcpd.sh.sample index 17472ab3bb71..63bc57ba0f3d 100644 --- a/net/isc-dhcp31-server/files/isc-dhcpd.sh.sample +++ b/net/isc-dhcp31-server/files/isc-dhcpd.sh.sample @@ -2,77 +2,47 @@ # # $FreeBSD$ # -# Start or stop isc-dhcpd. +# PROVIDE: dhcpd +# REQUIRE: DAEMON +# KEYWORD: FreeBSD +# +# Add the following line to /etc/rc.conf to enable dhcpd: +# +# dhcpd_enable="YES" # -rc_file=${0##*/} -rc_arg=$1 - -# override these variables in ${PREFIX}/etc/rc.isc-dhcpd.conf -dhcpd_options= # command option(s) -dhcpd_ifaces= # ethernet interface(s) - -if ! PREFIX=$(expr $0 : "\(/.*\)/etc/rc\.d/${rc_file}\$"); then - echo "${rc_file}: Cannot determine PREFIX." >&2 - echo "Please use the complete pathname." >&2 - exit 64 -fi +# override these variables in /etc/rc.conf +dhcpd_enable=NO +dhcpd_flags= # command option(s) +dhcpd_conf=%%PREFIX%%/etc/dhcpd.conf # configuration file +dhcpd_ifaces= # ethernet interface(s) -rcconf_dir=${PREFIX}/etc -rcconf_file=rc.${rc_file%.sh}.conf -rcconf_path=${rcconf_dir}/${rcconf_file} +dhcpd_precmd () +{ + dhcpd_rcconf=%%PREFIX%%/etc/rc.isc-dhcpd.conf -if [ -f ${rcconf_path} ]; then - . ${rcconf_path} -fi + if [ -f ${dhcpd_rcconf} ]; then + warn "${dhcpd_rcconf} is obsolete, use /etc/rc.conf instead." + . ${dhcpd_rcconf} -program_dir=${PREFIX}/sbin -program_file=dhcpd -program_path=${program_dir}/${program_file} + if [ -n "${dhcpd_options}" -a -z "${rc_flags}" ]; then + warn "dhcpd_options is obsolete, use dhcpd_flags instead." + rc_flags=${dhcpd_options} + fi + fi -config_dir=${PREFIX}/etc -config_file=${program_file}.conf -config_path=${config_dir}/${config_file} + rc_flags="${rc_flags} -cf ${dhcpd_conf} ${dhcpd_ifaces}" +} -pid_dir=/var/run -pid_file=${program_file}.pid -pid_path=${pid_dir}/${pid_file} +. %%RC_SUBR%% -syslog_facility=daemon.err +name=dhcpd +rcvar=$(set_rcvar) -case "$rc_arg" in -start) - if [ ! -x ${program_path} ]; then - logger -sp ${syslog_facility} -t ${program_file} \ - "unable to start: ${program_path} is missing." - exit 72 - fi - if [ ! -f ${config_path} ]; then - logger -sp ${syslog_facility} -t ${program_file} \ - "unable to start: ${config_path} is missing." - exit 72 - fi - ${program_path} ${dhcpd_options} ${dhcpd_ifaces} && - echo -n " ${program_file}" - ;; -stop) - if [ -r ${pid_path} ]; then - kill $(cat ${pid_path}) 2> /dev/null - else - killall ${program_file} 2> /dev/null - fi - ;; -restart) - $0 stop - $0 start - ;; -status) - ps -auxww | egrep ${program_file} | egrep -v "($0|egrep)" - ;; -*) - echo "usage: ${rc_file} {start|stop|restart|status}" >&2 - exit 64 - ;; -esac +command=%%PREFIX%%/sbin/${name} +pidfile=/var/run/${name}.pid +required_files=${dhcpd_conf} +start_precmd=${name}_precmd -exit 0 +load_rc_config ${name} +run_rc_command "$1" |