- 论坛徽章:
- 0
|
关于webmin
安装时有个选择,是开机启动,他会在/etc/rc.d/rc3.d/S99webmin 的脚本.
我的是这样的:"*"
#!/bin/sh
# description: Start/stop Webmin
# chkconfig: 2345 99 99
case "$1" in
'start')
/etc/firewall/start >;/dev/null 2>;&1 </dev/null
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
touch /var/lock/subsys/webmin
fi
;;
'stop')
/etc/firewall/stop
RETVAL=$?
if [ "$RETVAL" = "0" ]; then
rm -f /var/lock/subsys/webmin
fi
;;
'status')
pidfile=`grep "^pidfile=" /etc/firewall/miniserv.conf | sed -e 's/pidfile=//g'`
if [ -s $pidfile ]; then
pid=`cat $pidfile`
kill -0 $pid >;/dev/null 2>;&1
if [ "$?" = "0" ]; then
echo "webmin (pid $pid) is running"
RETVAL=0
else
echo "webmin is stopped"
RETVAL=1
fi
else
echo "webmin is stopped"
RETVAL=1
fi
;;
'restart')
/etc/firewall/stop && /etc/firewall/start
RETVAL=$?
;;
*)
echo "Usage: $0 { start | stop }"
RETVAL=1
;;
esac
exit $RETVL |
|