]> git.pld-linux.org Git - packages/xorg-driver-video-fglrx.git/blob - atieventsd.init
- fix building with linux 4.7
[packages/xorg-driver-video-fglrx.git] / atieventsd.init
1 #!/bin/sh
2 #
3 # atieventsd    ATI External Events Daemon
4 #
5 # chkconfig:    345 50 50
6 #
7 # description:  ATI External Events Daemon
8 #
9 # processname:  atieventsd
10 # config:
11 # pidfile:      /var/run/atieventsd.pid
12
13 # Source function library
14 . /etc/rc.d/init.d/functions
15
16 DAEMONOPTS=""
17 DAEMONXAUTHFILE=/var/run/$DAEMONNAME.Xauthority
18
19 # Get service config - may override defaults
20 [ -f /etc/sysconfig/atieventsd ] && . /etc/sysconfig/atieventsd
21
22 start() {
23         # Check if the service is already running?
24         if [ -f /var/lock/subsys/atieventsd ]; then
25                 msg_already_running "atieventsd"
26                 return
27         fi
28
29         msg_starting "atieventsd"
30         XAUTHORITY=$DAEMONXAUTHFILE daemon /usr/sbin/atieventsd $DAEMONOPTS
31         pidofproc atieventsd > /var/run/atieventsd.pid
32         RETVAL=$?
33         [ $RETVAL -eq 0 ] && touch /var/lock/subsys/atieventsd
34 }
35
36 stop() {
37         if [ ! -f /var/lock/subsys/atieventsd ]; then
38                 msg_not_running "atieventsd"
39                 return
40         fi
41
42         # Stop daemons.
43         msg_stopping "atieventsd"
44         killproc --pidfile /var/run/atieventsd.pid atieventsd
45         rm -f /var/lock/subsys/atieventsd
46 }
47
48 condrestart() {
49         if [ ! -f /var/lock/subsys/atieventsd ]; then
50                 msg_not_running "atieventsd"
51                 RETVAL=$1
52                 return
53         fi
54
55         stop
56         start
57 }
58
59 RETVAL=0
60 # See how we were called.
61 case "$1" in
62   start)
63         start
64         ;;
65   stop)
66         stop
67         ;;
68   restart)
69         stop
70         start
71         ;;
72   try-restart)
73         condrestart 0
74         ;;
75   force-reload)
76         condrestart 7
77         ;;
78   status)
79         status atieventsd
80         RETVAL=$?
81         ;;
82   *)
83         msg_usage "$0 {start|stop|restart|try-restart|force-reload|status}"
84         exit 3
85 esac
86
87 exit $RETVAL
This page took 0.076152 seconds and 3 git commands to generate.