2013-05-27 07:10:34 +00:00
|
|
|
--- conserver-8.1.16/contrib/redhat-rpm/conserver.init 2013-05-27 10:53:15.541680201 +0800
|
|
|
|
+++ conserver-8.1.16-diffinit/contrib/redhat-rpm/conserver.init 2013-05-27 10:42:14.414593578 +0800
|
|
|
|
@@ -16,14 +16,53 @@
|
|
|
|
# Description: Console server
|
|
|
|
### END INIT INFO
|
|
|
|
|
|
|
|
-# Source function library.
|
|
|
|
-. /etc/rc.d/init.d/functions
|
2008-06-26 15:15:09 +00:00
|
|
|
+RHPassed()
|
|
|
|
+{
|
|
|
|
+ passed
|
|
|
|
+ echo
|
|
|
|
+}
|
2008-06-26 15:01:16 +00:00
|
|
|
+RHSuccess()
|
|
|
|
+{
|
|
|
|
+ success
|
|
|
|
+ echo
|
|
|
|
+}
|
|
|
|
+RHFailure()
|
|
|
|
+{
|
|
|
|
+ failure
|
|
|
|
+ echo
|
|
|
|
+}
|
2008-06-19 14:26:47 +00:00
|
|
|
+MStatus()
|
|
|
|
+{
|
2008-06-27 16:06:12 +00:00
|
|
|
+ ps ax|grep -v grep|grep /usr/sbin/conserver >& /dev/null
|
2008-06-19 14:26:47 +00:00
|
|
|
+ if [ "$?" = "0" ]; then
|
|
|
|
+ RVAL=0
|
|
|
|
+ echo "conserver is running"
|
|
|
|
+ else
|
|
|
|
+ RVAL=3
|
|
|
|
+ echo "consever is not running"
|
|
|
|
+ fi
|
|
|
|
+ return $RVAL
|
|
|
|
+}
|
|
|
|
|
|
|
|
-# Source networking configuration.
|
|
|
|
-. /etc/sysconfig/network
|
|
|
|
|
|
|
|
-# Check that networking is up.
|
|
|
|
-[ ${NETWORKING} = "no" ] && exit 0
|
|
|
|
+# Source function library.
|
|
|
|
+if [ -f /etc/rc.d/init.d/functions ]; then
|
|
|
|
+ . /etc/rc.d/init.d/functions
|
|
|
|
+ DAEMON=daemon
|
2008-06-26 15:01:16 +00:00
|
|
|
+ SUCCESS=RHSuccess
|
|
|
|
+ FAILURE=RHFailure
|
2008-06-26 15:19:19 +00:00
|
|
|
+ PASSED=RHPassed
|
2008-06-19 14:26:47 +00:00
|
|
|
+ STATUS=status
|
|
|
|
+elif [ -f /lib/lsb/init-functions ]; then
|
|
|
|
+ . /lib/lsb/init-functions
|
|
|
|
+ DAEMON=start_daemon
|
|
|
|
+ SUCCESS=log_success_msg
|
|
|
|
+ FAILURE=log_failure_msg
|
|
|
|
+ PASSED=log_warning_msg
|
|
|
|
+ STATUS=MStatus
|
|
|
|
+else
|
|
|
|
+ echo "Error, not RedHat and not lsb, do not know how to run this platform"
|
|
|
|
+fi
|
|
|
|
|
|
|
|
# make sure conserver is installed and executable
|
|
|
|
[ -x /usr/sbin/conserver ] || exit 1
|
2013-05-27 07:10:34 +00:00
|
|
|
@@ -33,23 +72,45 @@
|
2008-05-07 19:59:45 +00:00
|
|
|
case "$1" in
|
|
|
|
start)
|
|
|
|
echo -n "Starting conserver: "
|
|
|
|
- daemon conserver -d
|
2008-06-19 14:26:47 +00:00
|
|
|
- echo
|
|
|
|
+ $DAEMON /usr/sbin/conserver -o -O1 -d
|
2008-05-07 19:59:45 +00:00
|
|
|
touch /var/lock/subsys/conserver
|
2008-06-19 14:26:47 +00:00
|
|
|
+ $STATUS conserver >& /dev/null
|
|
|
|
+ if [ "$?" != "0" ]; then
|
|
|
|
+ $FAILURE
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+ $SUCCESS
|
|
|
|
;;
|
|
|
|
stop)
|
|
|
|
+ $STATUS conserver >& /dev/null
|
|
|
|
+ if [ "$?" != "0" ]; then
|
|
|
|
+ echo -n "conserver not running, not stopping "
|
|
|
|
+ $PASSED
|
2013-05-24 06:52:09 +00:00
|
|
|
+ exit 0
|
2008-06-19 14:26:47 +00:00
|
|
|
+ fi
|
|
|
|
echo -n "Shutting down conserver: "
|
|
|
|
killproc conserver
|
|
|
|
- echo
|
|
|
|
rm -f /var/lock/subsys/conserver
|
|
|
|
+ $STATUS conserver >& /dev/null
|
|
|
|
+ if [ "$?" == "0" ]; then
|
|
|
|
+ $FAILURE
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+ $SUCCESS
|
|
|
|
;;
|
|
|
|
status)
|
|
|
|
- status conserver
|
|
|
|
+ $STATUS conserver
|
2013-05-24 06:52:09 +00:00
|
|
|
+ exit $?
|
2008-06-19 14:26:47 +00:00
|
|
|
;;
|
|
|
|
restart)
|
|
|
|
- echo -n "Restarting conserver: "
|
|
|
|
- killproc conserver -HUP
|
2008-06-26 15:15:09 +00:00
|
|
|
- echo
|
2008-06-19 14:26:47 +00:00
|
|
|
+ $STATUS conserver >& /dev/null
|
|
|
|
+ if [ "$?" != "0" ]; then
|
|
|
|
+ exec $0 start
|
|
|
|
+ else
|
|
|
|
+ echo -n "Restarting conserver: "
|
|
|
|
+ killproc conserver -HUP
|
|
|
|
+ fi
|
|
|
|
+ $SUCCESS
|
2008-05-07 19:59:45 +00:00
|
|
|
;;
|
2008-06-19 14:26:47 +00:00
|
|
|
*)
|
2008-06-26 15:15:09 +00:00
|
|
|
echo "Usage: conserver {start|stop|restart|status}"
|