]> git.pld-linux.org Git - packages/XFree86.git/commitdiff
- use functions auto/th/xorg-app-xfs-1_0_6-1 auto/th/xorg-app-xfs-1_0_7-1 auto/th/xorg-app-xfs-1_0_8-1 auto/ti/xorg-app-xfs-1_0_6-1 auto/ti/xorg-app-xfs-1_0_7-1 auto/ti/xorg-app-xfs-1_0_8-1
authorJakub Bogusz <qboosh@pld-linux.org>
Sun, 2 Dec 2007 13:03:08 +0000 (13:03 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
- added try-restart action (LSB 3.1)

Changed files:
    xfs.init -> 1.13

xfs.init

index c118987f5b9c708d25eb978c5ce790600216e8af..0f7e499674a6db0c0f9b6e63fd0b13fa70430165 100644 (file)
--- a/xfs.init
+++ b/xfs.init
@@ -19,11 +19,7 @@ if [ -f /etc/sysconfig/xfs ]; then
        . /etc/sysconfig/xfs
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
-       # Check if the service is already running?
+start() {
        if [ ! -f /var/lock/subsys/xfs ]; then
                msg_starting "X Font Server"
                rm -fr /tmp/.font-unix
@@ -35,8 +31,9 @@ case "$1" in
        else
                msg_already_running "X Font Server"
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/xfs ]; then
                msg_stopping "X Font Server"
                killproc xfs
@@ -44,28 +41,54 @@ case "$1" in
        else
                msg_not_running "X Font Server"
        fi
-       ;;
-  status)
-       status xfs
-       exit $?
-       ;;
-  restart)
-       $0 stop
-       $0 start
-       exit $?
-       ;;
-  reload|force-reload)
+}
+
+reload() {
        if [ -f /var/lock/subsys/xfs ]; then
                msg_reloading "X Font Server"
                killproc xfs -USR1
                RETVAL=$?
        else
                msg_not_running "X Font Server"
-               exit 7
+               RETVAL=7
        fi
+}
+
+condrestart() {
+       if [ -f /var/lock/subsys/xfs ]; then
+               stop
+               start
+       else
+               msg_not_running xfs
+               RETVAL=$1
+       fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
+       ;;
+  restart)
+       stop
+       start
+       ;;
+  try-restart)
+       condrestart 0
+       ;;
+  reload|force-reload)
+       reload
+       ;;
+  status)
+       status xfs
+       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
 
This page took 0.088064 seconds and 4 git commands to generate.