fix init script
- to add newline to [OK] - to ignore 'config file testing succeeded' output of slaptest
This commit is contained in:
parent
01e94086a8
commit
808537b99d
11
ldap.init
11
ldap.init
@ -125,10 +125,13 @@ function configtest() {
|
|||||||
# Check the configuration file.
|
# Check the configuration file.
|
||||||
slaptestout=`/sbin/runuser -m -s "$slaptest" -- "$user" $slaptestflags 2>&1`
|
slaptestout=`/sbin/runuser -m -s "$slaptest" -- "$user" $slaptestflags 2>&1`
|
||||||
slaptestexit=$?
|
slaptestexit=$?
|
||||||
|
# slaptestout=`echo $slaptestout 2>/dev/null | grep -v "config file testing succeeded"`
|
||||||
# print warning if slaptest passed but reports some problems
|
# print warning if slaptest passed but reports some problems
|
||||||
if test $slaptestexit == 0 -a -n "$slaptestout" ; then
|
if test $slaptestexit == 0 ; then
|
||||||
echo -n $"Checking configuration files for $prog: " ; warning ; echo
|
if echo "$slaptestout" | grep -v "config file testing succeeded" >/dev/null ; then
|
||||||
echo "$slaptestout"
|
echo -n $"Checking configuration files for $prog: " ; warning ; echo
|
||||||
|
echo "$slaptestout"
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
# report error if configuration file is wrong
|
# report error if configuration file is wrong
|
||||||
if test $slaptestexit != 0 ; then
|
if test $slaptestexit != 0 ; then
|
||||||
@ -166,6 +169,7 @@ function start() {
|
|||||||
daemon --check=$prog ${slapd} -h "\"$harg\"" -u ${user} $OPTIONS $SLAPD_OPTIONS
|
daemon --check=$prog ${slapd} -h "\"$harg\"" -u ${user} $OPTIONS $SLAPD_OPTIONS
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ldap
|
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/ldap
|
||||||
|
echo
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -176,6 +180,7 @@ function stop() {
|
|||||||
killproc ${slapd}
|
killproc ${slapd}
|
||||||
RETVAL=$?
|
RETVAL=$?
|
||||||
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ldap /var/run/slapd.args
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/ldap /var/run/slapd.args
|
||||||
|
echo
|
||||||
return $RETVAL
|
return $RETVAL
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user