2008-02-11 22:16:36 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# open-isns isnsd init script
|
|
|
|
# # Copyright (C) 2007 Albert Pauw
|
|
|
|
#
|
|
|
|
# chkconfig: - 39 35
|
|
|
|
#
|
|
|
|
### BEGIN INIT INFO
|
|
|
|
# Provides: isnsd
|
|
|
|
# Required-Start: $network
|
|
|
|
# Short-Description: Starts and stops the generic iSNS daemon
|
|
|
|
# Description: isnsd provides a iSNS daemon and iSNS management tools.
|
|
|
|
### END INIT INFO
|
|
|
|
#
|
|
|
|
#
|
|
|
|
# pidfile: /var/run/isns.pid
|
|
|
|
|
|
|
|
# Source function library.
|
|
|
|
. /etc/init.d/functions
|
|
|
|
|
|
|
|
PATH=/sbin:/bin:/usr/sbin:/usr/bin
|
|
|
|
RETVAL=0
|
|
|
|
|
|
|
|
start()
|
|
|
|
{
|
2012-09-10 20:27:13 +00:00
|
|
|
[ `id -u` = 0 ] || exit 4
|
|
|
|
|
2008-02-11 22:16:36 +00:00
|
|
|
echo -n "Starting iSNS Server:"
|
|
|
|
daemon isnsd
|
|
|
|
echo
|
|
|
|
RETVAL=$?
|
|
|
|
if [ $RETVAL -eq "0" ]; then
|
|
|
|
touch /var/lock/subsys/isnsd
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
|
|
|
stop()
|
|
|
|
{
|
2012-09-10 20:27:13 +00:00
|
|
|
[ `id -u` = 0 ] || exit 4
|
|
|
|
|
2008-02-11 22:16:36 +00:00
|
|
|
echo -n "Stopping iSNS Server: "
|
|
|
|
if [ ! -f /var/lock/subsys/isnsd ]; then
|
|
|
|
echo
|
|
|
|
success
|
|
|
|
return
|
|
|
|
fi
|
|
|
|
|
|
|
|
killproc isnsd
|
|
|
|
echo
|
|
|
|
RETVAL=$?
|
|
|
|
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/isnsd
|
|
|
|
}
|
|
|
|
|
|
|
|
restart()
|
|
|
|
{
|
|
|
|
stop
|
|
|
|
start
|
|
|
|
}
|
|
|
|
|
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
start
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stop
|
|
|
|
;;
|
2012-09-10 20:27:13 +00:00
|
|
|
reload)
|
|
|
|
exit 3
|
|
|
|
;;
|
|
|
|
force-reload)
|
|
|
|
restart
|
|
|
|
;;
|
2008-02-11 22:16:36 +00:00
|
|
|
restart)
|
|
|
|
restart
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
status isnsd
|
|
|
|
RETVAL=$?
|
|
|
|
;;
|
2012-09-10 20:27:13 +00:00
|
|
|
condrestart|try-restart)
|
2008-02-11 22:16:36 +00:00
|
|
|
[ -f /var/lock/subsys/isnsd ] && restart
|
|
|
|
;;
|
|
|
|
*)
|
2012-09-10 20:27:13 +00:00
|
|
|
echo $"Usage: $0 {start|stop|restart|status|force-reload|condrestart|try-restart}"
|
|
|
|
exit 2
|
2008-02-11 22:16:36 +00:00
|
|
|
esac
|
|
|
|
|
|
|
|
exit $RETVAL
|