2009-09-26 14:35:50 +00:00
|
|
|
#!/bin/bash
|
|
|
|
|
|
|
|
# general config
|
2009-09-26 16:05:27 +00:00
|
|
|
. /opt/etc/rc.conf
|
|
|
|
. /opt/etc/rc.d/functions
|
2009-09-26 14:35:50 +00:00
|
|
|
|
2009-09-26 16:05:27 +00:00
|
|
|
PID=`pidof -o %PPID /opt/sbin/kpasswdd`
|
2009-09-26 14:35:50 +00:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
stat_busy "Starting heimdal kpasswdd"
|
|
|
|
if [ -z "$PID" ]; then
|
2009-09-26 16:05:27 +00:00
|
|
|
/opt/sbin/kpasswdd &
|
2009-09-26 14:35:50 +00:00
|
|
|
fi
|
|
|
|
if [ ! -z "$PID" -o $? -gt 0 ]; then
|
|
|
|
stat_fail
|
|
|
|
else
|
|
|
|
add_daemon kpasswd
|
|
|
|
stat_done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
stat_busy "Stopping heimdal kpasswdd"
|
|
|
|
[ ! -z "$PID" ] && kill $PID &> /dev/null
|
|
|
|
if [ $? -gt 0 ]; then
|
|
|
|
stat_fail
|
|
|
|
else
|
|
|
|
rm_daemon kpasswd
|
|
|
|
stat_done
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
$0 stop
|
|
|
|
sleep 1
|
|
|
|
$0 start
|
|
|
|
;;
|
|
|
|
*)
|
|
|
|
echo "usage: $0 {start|stop|restart}"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
exit 0
|