SOURCES: xrdp.init - add try-restart, cosmetics

glen glen at pld-linux.org
Thu Jul 3 07:54:07 CEST 2008


Author: glen                         Date: Thu Jul  3 05:54:07 2008 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- add try-restart, cosmetics

---- Files affected:
SOURCES:
   xrdp.init (1.1 -> 1.2) 

---- Diffs:

================================================================
Index: SOURCES/xrdp.init
diff -u SOURCES/xrdp.init:1.1 SOURCES/xrdp.init:1.2
--- SOURCES/xrdp.init:1.1	Wed Jul  2 19:08:40 2008
+++ SOURCES/xrdp.init	Thu Jul  3 07:54:00 2008
@@ -52,6 +52,28 @@
 	fi
 }
 
+reload() {
+	if [ -f /var/lock/subsys/xrdp ]; then
+		msg_reloading "xrdp"
+		killproc xrdp -HUP
+		killproc sesman -HUP
+		RETVAL=$?
+	else
+		msg_not_running "xrdp"
+		exit 7
+	fi
+}
+
+condrestart() {
+	if [ -f /var/lock/subsys/xrdp ]; then
+		stop
+		start
+	else
+		msg_not_running "xrdp"
+		RETVAL=$1
+	fi
+}
+
 RETVAL=0
 # See how we were called.
 case "$1" in
@@ -61,27 +83,22 @@
   stop)
   	stop
 	;;
-  status)
-	status xrdp
-	exit $?
-	;;
   restart)
 	stop
 	start
 	;;
+  try-restart)
+	condrestart 0
+	;;
   reload|force-reload)
-	if [ -f /var/lock/subsys/xrdp ]; then
-		msg_reloading "xrdp"
-		killproc xrdp -HUP
-		killproc sesman -HUP
-		RETVAL=$?
-	else
-		msg_not_running "xrdp"
-		exit 7
-	fi
+	reload
+	;;
+  status)
+	status xrdp
+	exit $?
 	;;
   *)
-	msg_usage "$0 {start|stop|restart|reload|force-reload|status}"
+	msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
 	exit 3
 esac
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/SOURCES/xrdp.init?r1=1.1&r2=1.2&f=u



More information about the pld-cvs-commit mailing list