fix bug 169416
This commit is contained in:
parent
96c79d13ab
commit
31ab244dd2
27
named.init
27
named.init
@ -28,7 +28,18 @@ prog=$named
|
|||||||
|
|
||||||
[ -x /usr/sbin/$named ] || exit 1
|
[ -x /usr/sbin/$named ] || exit 1
|
||||||
|
|
||||||
[ -r ${ROOTDIR}/etc/named.conf ] || exit 1
|
named_conf=${ROOTDIR}/etc/named.conf
|
||||||
|
c_opt=0
|
||||||
|
if [[ "${OPTIONS}" = *-c* ]]; then
|
||||||
|
named_conf=`echo ${OPTIONS} | sed 's/^.*-c[\ \ ]//;s/[\ \ ].*$//'`;
|
||||||
|
c_opt=1;
|
||||||
|
fi;
|
||||||
|
|
||||||
|
[ -r ${named_conf} ] || exit 1
|
||||||
|
|
||||||
|
if [ ${c_opt} -eq 0 ]; then
|
||||||
|
named_conf='';
|
||||||
|
fi;
|
||||||
|
|
||||||
[ -n "$ROOTDIR" ] && ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`
|
[ -n "$ROOTDIR" ] && ROOTDIR=`echo $ROOTDIR | sed 's#//*#/#g;s#/$##'`
|
||||||
|
|
||||||
@ -55,10 +66,6 @@ start() {
|
|||||||
mount -tproc none ${ROOTDIR}/proc >/dev/null 2>&1
|
mount -tproc none ${ROOTDIR}/proc >/dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [[ "${OPTIONS}" = *-c* ]]; then
|
|
||||||
cf=`echo ${OPTIONS} | sed 's/^.*-c[\ \ ]//;s/[\ \ ].*$//'`;
|
|
||||||
ckcf_options="$ckcf_options $cf";
|
|
||||||
fi;
|
|
||||||
no_write_master_zones=0
|
no_write_master_zones=0
|
||||||
if [ -e /etc/selinux/config ]; then
|
if [ -e /etc/selinux/config ]; then
|
||||||
. /etc/selinux/config
|
. /etc/selinux/config
|
||||||
@ -89,7 +96,7 @@ start() {
|
|||||||
fi;
|
fi;
|
||||||
fi
|
fi
|
||||||
conf_ok=0;
|
conf_ok=0;
|
||||||
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options >/dev/null 2>&1; then
|
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} >/dev/null 2>&1; then
|
||||||
conf_ok=1;
|
conf_ok=1;
|
||||||
else
|
else
|
||||||
RETVAL=$?;
|
RETVAL=$?;
|
||||||
@ -106,7 +113,7 @@ start() {
|
|||||||
fi;
|
fi;
|
||||||
fi;
|
fi;
|
||||||
else
|
else
|
||||||
named_err="`/usr/sbin/named-checkconf $ckcf_options 2>&1`";
|
named_err="`/usr/sbin/named-checkconf $ckcf_options $named_conf 2>&1`";
|
||||||
echo
|
echo
|
||||||
echo $"Error in named configuration"':';
|
echo $"Error in named configuration"':';
|
||||||
echo "$named_err";
|
echo "$named_err";
|
||||||
@ -181,11 +188,7 @@ checkconfig() {
|
|||||||
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
|
OPTIONS="${OPTIONS} -t ${ROOTDIR}"
|
||||||
ckcf_options="$ckcf_options -t ${ROOTDIR}";
|
ckcf_options="$ckcf_options -t ${ROOTDIR}";
|
||||||
fi;
|
fi;
|
||||||
if [[ "${OPTIONS}" = *-c* ]]; then
|
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ${named_conf} | cat ; then
|
||||||
cf=`echo ${OPTIONS} | sed 's/^.*-c[\ \ ]//;s/[\ \ ].*$//'`;
|
|
||||||
ckcf_options="$ckcf_options $cf";
|
|
||||||
fi;
|
|
||||||
if [ -x /usr/sbin/named-checkconf ] && [ -x /usr/sbin/named-checkzone ] && /usr/sbin/named-checkconf $ckcf_options ; then
|
|
||||||
return 0;
|
return 0;
|
||||||
else
|
else
|
||||||
return 1;
|
return 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user