FreeBSD Bugzilla – Attachment 94839 Details for
Bug 133072
[patch] net/isc-dhcp30-server, net/isc-dhcp30-server: check configuration file before restart
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
implement-configuration-file-check.diff
implement-configuration-file-check.diff (text/plain), 2.81 KB, created by
Eygene Ryabinkin
on 2009-03-25 20:00:02 UTC
(
hide
)
Description:
implement-configuration-file-check.diff
Filename:
MIME Type:
Creator:
Eygene Ryabinkin
Created:
2009-03-25 20:00:02 UTC
Size:
2.81 KB
patch
obsolete
>From 5d719245842864e73515d976b8a32f20a9437db3 Mon Sep 17 00:00:00 2001 >From: Eygene Ryabinkin <rea-fbsd@codelabs.ru> >Date: Wed, 25 Mar 2009 22:29:31 +0300 > >This feature is very handy, because when 'restart' cmd is run with the >broken configuration file, rc.d script will show that it stops and >starts the daemon. And one will discover that dhcp daemon isn't running >only on the next restart or looking at the process list -- not cool. > >Signed-off-by: Eygene Ryabinkin <rea-fbsd@codelabs.ru> >--- > net/isc-dhcp30-server/files/isc-dhcpd.in | 20 ++++++++++++++++++++ > net/isc-dhcp31-server/files/isc-dhcpd.in | 20 ++++++++++++++++++++ > 2 files changed, 40 insertions(+), 0 deletions(-) > >diff --git a/net/isc-dhcp30-server/files/isc-dhcpd.in b/net/isc-dhcp30-server/files/isc-dhcpd.in >index 9532d91..0bc65bb 100644 >--- a/net/isc-dhcp30-server/files/isc-dhcpd.in >+++ b/net/isc-dhcp30-server/files/isc-dhcpd.in >@@ -701,6 +701,25 @@ dhcpd_uninstall () > fi > } > >+dhcpd_checkconfig () >+{ >+ local rc_flags_saved rc_flags_our >+ rc_flags_saved="$rc_flags" >+ setup_flags >+ # Eliminate '-q' flag if it is present >+ rc_flags_our=`echo "${rc_flags}" | sed -Ee's/(^-q | -q | -q$)'//` >+ rc_flags="${rc_flags_saved}" >+ if ${command} -t -q ${rc_flags_our}; then >+ true >+ else >+ echo "Configuration file sanity check failed:" >+ echo "=======================================" >+ ${command} -t ${rc_flags_our} >+ echo "=======================================" >+ false >+ fi >+} >+ > rcvar=${name}_enable > load_rc_config ${name} > >@@ -719,6 +738,7 @@ pidfile=${_dhcpd_pidfile} > required_files=${dhcpd_conf} > start_precmd=${name}_precmd > stop_postcmd=${name}_postcmd >+restart_precmd="dhcpd_checkconfig" > install_cmd=dhcpd_install > uninstall_cmd=dhcpd_uninstall > extra_commands="install uninstall" >diff --git a/net/isc-dhcp31-server/files/isc-dhcpd.in b/net/isc-dhcp31-server/files/isc-dhcpd.in >index 6ed05f8..b526bfb 100644 >--- a/net/isc-dhcp31-server/files/isc-dhcpd.in >+++ b/net/isc-dhcp31-server/files/isc-dhcpd.in >@@ -700,6 +700,25 @@ dhcpd_uninstall () > fi > } > >+dhcpd_checkconfig () >+{ >+ local rc_flags_saved rc_flags_our >+ rc_flags_saved="$rc_flags" >+ setup_flags >+ # Eliminate '-q' flag if it is present >+ rc_flags_our=`echo "${rc_flags}" | sed -Ee's/(^-q | -q | -q$)'//` >+ rc_flags="${rc_flags_saved}" >+ if ${command} -t -q ${rc_flags_our}; then >+ true >+ else >+ echo "Configuration file sanity check failed:" >+ echo "=======================================" >+ ${command} -t ${rc_flags_our} >+ echo "=======================================" >+ false >+ fi >+} >+ > rcvar=${name}_enable > load_rc_config ${name} > >@@ -718,6 +737,7 @@ pidfile=${_dhcpd_pidfile} > required_files=${dhcpd_conf} > start_precmd=${name}_precmd > stop_postcmd=${name}_postcmd >+restart_precmd="dhcpd_checkconfig" > install_cmd=dhcpd_install > uninstall_cmd=dhcpd_uninstall > extra_commands="install uninstall" >-- >1.6.1.3
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 133072
: 94839