aboutsummaryrefslogtreecommitdiffstats
path: root/net/isc-dhcp42-server
diff options
context:
space:
mode:
authorzi <zi@FreeBSD.org>2012-03-19 09:28:35 +0800
committerzi <zi@FreeBSD.org>2012-03-19 09:28:35 +0800
commit2d0d84d009a961311c9133e8b1620fa39820d60b (patch)
treeea94ddb8fc1570996960c5d4d76f3893c1790591 /net/isc-dhcp42-server
parentb906e4893ad6e86a9478f30a46675dd46dcf2036 (diff)
downloadfreebsd-ports-gnome-2d0d84d009a961311c9133e8b1620fa39820d60b.tar.gz
freebsd-ports-gnome-2d0d84d009a961311c9133e8b1620fa39820d60b.tar.zst
freebsd-ports-gnome-2d0d84d009a961311c9133e8b1620fa39820d60b.zip
- Resolve issue where the the daemon would fail to start [1]
- Resolve issue on systems set to UTC time would fail copying /etc/localtime to the chroot [2] PR: ports/162447 [1] Submitted by: Hilko Meyer <hilko.meyer@gmx.de> [1] Reported by: dougb@ [2] Feature safe: yes
Diffstat (limited to 'net/isc-dhcp42-server')
-rw-r--r--net/isc-dhcp42-server/files/isc-dhcpd.in17
1 files changed, 14 insertions, 3 deletions
diff --git a/net/isc-dhcp42-server/files/isc-dhcpd.in b/net/isc-dhcp42-server/files/isc-dhcpd.in
index 18f19bd506b7..66a2a9cb9550 100644
--- a/net/isc-dhcp42-server/files/isc-dhcpd.in
+++ b/net/isc-dhcp42-server/files/isc-dhcpd.in
@@ -384,7 +384,10 @@ setup_chroot ()
eval "safe_copy \${${name}_conffile} \${_dhcpd_conffile}"
eval "safe_copy \${${name}_etcdir}/\$_hconf \${_dhcpd_etcdir}/\$_hconf"
eval "safe_copy \${${name}_etcdir}/\$_hosts \${_dhcpd_etcdir}/\$_hosts"
- eval "safe_copy \${${name}_etcdir}/\$_ltime \${_dhcpd_etcdir}/\$_ltime"
+ # copy localtime only if it exists
+ if eval "[ -f \"\${${name}_etcdir}/\$_ltime\" ]"; then
+ eval "safe_copy \${${name}_etcdir}/\$_ltime \${_dhcpd_etcdir}/\$_ltime"
+ fi
eval "safe_copy \${${name}_etcdir}/\$_rconf \${_dhcpd_etcdir}/\$_rconf"
# copy dhcpd_includedir if defined and available
if eval "[ -d \"\${${name}_includedir}\" ]"; then
@@ -476,6 +479,13 @@ dhcpd_postcmd ()
cleanup_chroot
}
+dhcpd_restartprecmd ()
+{
+ setup_chroot
+ setup_flags
+ dhcpd_checkconfig
+}
+
dhcpd_checkconfig ()
{
local rc_flags_mod
@@ -508,8 +518,9 @@ pidfile=${_dhcpd_pidfile}
eval "required_files=\${${name}_conf}"
start_precmd=dhcpd_precmd
stop_postcmd=dhcpd_postcmd
-restart_precmd="dhcpd_checkconfig"
+restart_precmd="dhcpd_restartprecmd"
uninstall_cmd=dhcpd_uninstall
-extra_commands="uninstall"
+configtest_cmd="dhcpd_restartprecmd"
+extra_commands="uninstall configtest"
run_rc_command "$1"