Subversion Repositories configs

Rev

Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
4 - 1
#!/bin/bash
2
#
3
#	/etc/rc.d/init.d/wdaemon
4
#
5
# Starts the wdaemon
6
#
7
# chkconfig: - 95 5
8
# description: helps X.org to support Wacom tablets hotplugging by creating \
9
#    permanent uinput devices that may be feeded by real tablets events while \
10
#    the hardware is present.
11
# processname: wdaemon
12
 
13
# Source function library.
14
. /etc/init.d/functions
15
 
16
test -x /usr/bin/wdaemon || exit 0
17
 
18
RETVAL=0
19
 
20
#
21
#	See how we were called.
22
#
23
 
24
prog="wdaemon"
25
 
26
start() {
27
	# Check if there's already a configuration present
28
	if [ ! -f /etc/wdaemon.conf ]; then
29
	    echo "wdaemon configuration file not present yet";
30
	    return 0;
31
	fi
32
	# Check if wdaemon is already running
33
	if [ ! -f /var/lock/subsys/wdaemon ]; then
34
	    if [ -z "$(lsmod | grep uinput)" ]; then
35
	       echo -n $"Loading uinput module: "
36
	       modprobe uinput;
37
	       RETVAL=$?
38
	       [ $RETVAL -eq 0 ] && success || (failure; return $RETVAL);
39
	       echo;
40
            fi
41
	    echo -n $"Starting $prog: "
42
	    daemon /usr/bin/wdaemon -s -c /etc/wdaemon.conf -f;
43
	    RETVAL=$?
44
	    [ $RETVAL -eq 0 ] && (success; touch /var/lock/subsys/wdaemon) || failure;
45
	    echo
46
	fi
47
	return $RETVAL
48
}
49
 
50
stop() {
51
	echo -n $"Stopping $prog: "
52
	killproc /usr/bin/wdaemon
53
	RETVAL=$?
54
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/wdaemon
55
	echo
56
        return $RETVAL
57
}
58
 
59
 
60
restart() {
61
	stop
62
	start
63
}
64
 
65
reload() {
66
	restart
67
}
68
 
69
status_at() {
70
 	status /usr/bin/wdaemon
71
}
72
 
73
case "$1" in
74
start)
75
	start
76
	;;
77
stop)
78
	stop
79
	;;
80
reload|restart)
81
	restart
82
	;;
83
condrestart)
84
	if [ -f /var/lock/subsys/wdaemon ]; then
85
	    restart
86
	fi
87
	;;
88
status)
89
	status_at
90
	;;
91
*)
92
	echo $"Usage: $0 {start|stop|restart|condrestart|status}"
93
	exit 1
94
esac
95
 
96
exit $?
97
exit $RETVAL