6
6
# Required-Stop: $local_fs
7
7
# Should-Start: $remote_fs
8
8
# Should-Stop: $remote_fs
9
# X-Start-Before: xdm kdm gdm ldm sdm
9
10
# Default-Start: 2 3 4 5
10
11
# Default-Stop: 0 1 6
11
12
# Short-Description: load deamon for Logitech G15 keyboard lcd display
36
DEVICE=/dev/input/uinput
38
if [ ! -e "$DEVICE" ] ; then
39
modprobe -q uinput || true
41
if [ -e "$DEVICE" ]; then
39
[ "$timeout" ] || timeout=120
41
local count=$(($timeout * 10))
42
while [ $count != 0 ]; do
43
[ -e "$file" ] && return 0
48
if [ "$DEV" = ".none." ]; then
49
echo -n "Warning: uinput ($DEVICE) doesn't exist. The G-keys are unsupported..."
51
if [ ! -e /dev/input/uinput ] ; then
52
modprobe -q uinput || true
53
wait_for_file /dev/input/uinput 3 || return 1
58
if [ ! -e "$DAEMON" ] ; then
59
wait_for_file "$DAEMON" 7 || return 1
64
start-stop-daemon --stop --test --quiet --pidfile \
65
/var/run/$NAME.pid --exec $DAEMON
69
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
70
--exec $DAEMON -- $DAEMON_OPTS
75
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
76
--oknodo --retry 5 --exec $DAEMON
57
82
echo -n "Starting $DESC: "
59
start-stop-daemon --start --quiet --pidfile /var/run/$NAME.pid \
60
--exec $DAEMON -- $DAEMON_OPTS
83
load_uinput || echo -n ".../dev/input/uinput not found ..."
64
88
echo -n "Stopping $DESC: "
66
start-stop-daemon --stop --quiet --pidfile /var/run/$NAME.pid \
67
--oknodo --retry 5 --exec $DAEMON
78
100
# echo "Reloading $DESC configuration files."
79
101
# start-stop-daemon --stop --signal 1 --quiet --pidfile \
80
102
# /var/run/$NAME.pid --exec $DAEMON
84
106
# If the "reload" option is implemented, move the "force-reload"
86
108
# just the same as "restart" except that it does nothing if the
87
109
# daemon isn't already running.
88
110
# check wether $DAEMON is running. If so, restart
89
start-stop-daemon --stop --test --quiet --pidfile \
90
/var/run/$NAME.pid --exec $DAEMON \
111
is_running && $0 restart || exit 0
95
114
echo -n "Restarting $DESC: "
96
start-stop-daemon --stop --quiet --pidfile \
97
/var/run/$NAME.pid --exec $DAEMON
99
start-stop-daemon --start --quiet --pidfile \
100
/var/run/$NAME.pid --exec $DAEMON -- $DAEMON_OPTS
116
# the device is slow to shut-down
122
if [ "x$ACTION" = "xadd" ] ; then
124
wait_usr_mount || true
125
# it seems udev will not release a device if userspace is still
127
is_running && ( do_stop; sleep 0.5 )
129
elif [ "x$ACTION" = "xremove" ] ; then
132
echo "unknow udev action '$ACTION'"
104
138
N=/etc/init.d/$NAME
105
# echo "Usage: $N {start|stop|restart|reload|force-reload}" >&2
106
echo "Usage: $N {start|stop|restart|force-reload}" >&2
139
echo "Usage: $N {start|stop|restart|force-reload|udev}" >&2