# Get sysconfig
[ -f /etc/sysconfig/nscd ] && . /etc/sysconfig/nscd
-
+
+RETVAL=0
# See how we were called.
case "$1" in
- start)
+ start)
if [ ! -f /var/lock/subsys/nscd ]; then
msg_starting "Name Switch Cache Daemon"
daemon nscd
RETVAL=$?
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/nscd
else
- msg_Already_Running "Name Switch Cache Daemon"
- exit 1
+ msg_already_running "Name Switch Cache Daemon"
fi
- touch /var/lock/subsys/nscd
- ;;
- stop)
+ ;;
+ stop)
if [ -f /var/lock/subsys/nscd ]; then
msg_stopping "Name Switch Cache Daemon"
busy
/usr/sbin/nscd -K
rm -f /var/lock/subsys/nscd >/dev/null 2>&1
- deltext
ok
else
- msg_Not_Running "Name Switch Cache Daemon"
- exit 1
+ msg_not_running "Name Switch Cache Daemon"
fi
;;
status)
- status nscd
- ;;
- restart|reload)
- $0 stop
- $0 start
- ;;
- *)
- msg_Usage "$0 {start|stop|status|restart|reload}"
- exit 1
+ status nscd
+ exit $?
+ ;;
+ restart|force-reload)
+ $0 stop
+ $0 start
+ exit $?
;;
+ *)
+ msg_usage "$0 {start|stop|restart|force-reload|status}"
+ exit 3
esac
exit $RETVAL