From 2d7f45b0736112f615a744314ef5ab73d8f88994 Mon Sep 17 00:00:00 2001 From: ligc Date: Fri, 24 May 2013 06:52:09 +0000 Subject: [PATCH] make the conserver be LSB compatible, when conserver is not running, service conserver stop should exit 0, service conserver status should exit 3 Former-commit-id: dd6fcfb6ddeccd1d7ec7bbe15c3749b5a1a6cf74 --- conserver/initscript.patch | 22 ++++++++++++++++------ 1 file changed, 16 insertions(+), 6 deletions(-) diff --git a/conserver/initscript.patch b/conserver/initscript.patch index db9323a..1131a40 100644 --- a/conserver/initscript.patch +++ b/conserver/initscript.patch @@ -1,10 +1,19 @@ -diff -urN conserver-8.1.16/contrib/redhat-rpm/conserver.init conserver-8.1.16-diffinit/contrib/redhat-rpm/conserver.init ---- conserver-8.1.16/contrib/redhat-rpm/conserver.init 2003-02-27 21:06:50.000000000 -0500 -+++ conserver-8.1.16-diffinit/contrib/redhat-rpm/conserver.init 2008-06-27 12:05:28.000000000 -0400 -@@ -6,15 +6,53 @@ +--- conserver-8.1.16/contrib/redhat-rpm/conserver.init 2003-02-28 10:06:50.000000000 +0800 ++++ conserver-8.1.16-diffinit/contrib/redhat-rpm/conserver.init 2013-05-24 14:36:21.006320225 +0800 +@@ -6,15 +6,63 @@ # description: conserver is a serial-port console daemon # config: /etc/conserver.cf # ++### BEGIN INIT INFO ++# Provides: conserver ++# Required-Start: ++# Required-Stop: ++# Default-Start: 2 3 4 5 ++# Default-stop: ++# Short-Description: conserver ++# Description: Console server ++### END INIT INFO ++ +RHPassed() +{ + passed @@ -62,7 +71,7 @@ diff -urN conserver-8.1.16/contrib/redhat-rpm/conserver.init conserver-8.1.16-di # make sure conserver is installed and executable [ -x /usr/sbin/conserver ] || exit 1 -@@ -24,23 +62,44 @@ +@@ -24,23 +72,45 @@ case "$1" in start) echo -n "Starting conserver: " @@ -82,7 +91,7 @@ diff -urN conserver-8.1.16/contrib/redhat-rpm/conserver.init conserver-8.1.16-di + if [ "$?" != "0" ]; then + echo -n "conserver not running, not stopping " + $PASSED -+ exit 1 ++ exit 0 + fi echo -n "Shutting down conserver: " killproc conserver @@ -98,6 +107,7 @@ diff -urN conserver-8.1.16/contrib/redhat-rpm/conserver.init conserver-8.1.16-di status) - status conserver + $STATUS conserver ++ exit $? ;; restart) - echo -n "Restarting conserver: "