]> git.pld-linux.org Git - packages/X11.git/blob - xfs.init
- cleanup
[packages/X11.git] / xfs.init
1 #!/bin/sh
2 #
3 # xfs:          Starts the X Font Server
4 #
5 # Version:      $Revision$
6 #
7 # chkconfig:    345 90 10
8 # description:  Starts and stops the X Font Server at boot time and shutdown.
9 #
10 # processname:  xfs
11 # config:       /etc/X11/fs/config
12 # hide:         true
13
14 # Source function library.
15 . /etc/rc.d/init.d/functions
16
17 # Get service config
18 if [ -f /etc/sysconfig/xfs ]; then
19         . /etc/sysconfig/xfs
20 fi
21
22 start() {
23         if [ ! -f /var/lock/subsys/xfs ]; then
24                 msg_starting "X Font Server"
25                 rm -fr /tmp/.font-unix
26                 daemon xfs \
27                         $([ -n "$XFS_PORT" ] && echo "-port $XFS_PORT") \
28                         $([ -n "$XFS_OPTIONS" ] && echo "$XFS_OPTIONS")
29                 RETVAL=$?
30                 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/xfs
31         else
32                 msg_already_running "X Font Server"
33         fi
34 }
35
36 stop() {
37         if [ -f /var/lock/subsys/xfs ]; then
38                 msg_stopping "X Font Server"
39                 killproc xfs
40                 rm -f /var/lock/subsys/xfs
41         else
42                 msg_not_running "X Font Server"
43         fi
44 }
45
46 reload() {
47         if [ -f /var/lock/subsys/xfs ]; then
48                 msg_reloading "X Font Server"
49                 killproc xfs -USR1
50                 RETVAL=$?
51         else
52                 msg_not_running "X Font Server"
53                 RETVAL=7
54         fi
55 }
56
57 condrestart() {
58         if [ -f /var/lock/subsys/xfs ]; then
59                 stop
60                 start
61         else
62                 msg_not_running xfs
63                 RETVAL=$1
64         fi
65 }
66
67 RETVAL=0
68 # See how we were called.
69 case "$1" in
70   start)
71         start
72         ;;
73   stop)
74         stop
75         ;;
76   restart)
77         stop
78         start
79         ;;
80   try-restart)
81         condrestart 0
82         ;;
83   reload|force-reload)
84         reload
85         ;;
86   status)
87         status xfs
88         exit $?
89         ;;
90   *)
91         msg_usage "$0 {start|stop|restart|try-restart|reload|force-reload|status}"
92         exit 3
93 esac
94
95 exit $RETVAL
This page took 0.03643 seconds and 3 git commands to generate.