/etc/init.d/gpm is in gpm 1.20.4-4.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 | #!/bin/sh
#
### BEGIN INIT INFO
# Provides: gpm
# Required-Start: $remote_fs $syslog
# Required-Stop: $remote_fs $syslog
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: gpm sysv init script
# Description: general purpose mouse event server
### END INIT INFO
#
PIDFILE=/var/run/gpm.pid
GPM=/usr/sbin/gpm
CFG=/etc/gpm.conf
test -x $GPM || exit 0
. /lib/lsb/init-functions
if [ "$(id -u)" != "0" ]
then
log_failure_msg "You must be root to start, stop or restart gpm."
exit 1
fi
cmdln=
niceness=0
ssd_args="--quiet --oknodo --nicelevel $niceness --pidfile $PIDFILE --exec $GPM"
if [ -f $CFG ]; then
. $CFG
if [ -n "$device" ]; then cmdln="$cmdln -m $device"; fi
if [ -n "$type" ]; then cmdln="$cmdln -t $type"; fi
if [ -n "$responsiveness" ]; then cmdln="$cmdln -r $responsiveness"; fi
if [ -n "$sample_rate" ]; then cmdln="$cmdln -s $sample_rate"; fi
# Yes, this /IS/ correct! There is no space after -R!!!!!!
# I reserve the right to throw manpages at anyone who disagrees.
if [ -n "$repeat_type" ] && [ "$repeat_type" != "none" ]; then
cmdln="$cmdln -R$repeat_type"
fi
if [ -n "$append" ]; then cmdln="$cmdln $append"; fi
# If both the second device and type are specified, use it.
if [ -n "$device2" ] && [ -n "$type2" ] ; then
cmdln="$cmdln -M -m $device2 -t $type2"
fi
fi
gpm_strace () {
log_daemon_msg "Running mouse interface server under strace" "gpm"
eval strace -T -o /root/gpm.strace $GPM -V -D -e $cmdln > /root/gpm.out 2>&1
log_end_msg $?
return $?
}
gpm_start () {
log_daemon_msg "Starting mouse interface server" "gpm"
# HACK - kernel module init is asynchronous in kernel 2.6, EVEN FROM
# REQUEST_MODULE(). That would include 'mousedev'. The correct
# solution is a hotplug script, but we cannot depend on hotplug being
# available just yet, either kernel-side or user-side.
for foo in 1 2 3; do
if :< ${device-/dev/mouse}; then break; fi
sleep 1
done
start-stop-daemon --start $ssd_args -- $cmdln
log_end_msg $?
return $?
}
gpm_stop () {
log_daemon_msg "Stopping mouse interface server" "gpm"
start-stop-daemon --stop $ssd_args
log_end_msg $?
return $?
}
case "$1" in
strace)
gpm_strace || exit 1
;;
start)
gpm_start || exit 1
;;
stop)
gpm_stop || exit 1
;;
force-reload|restart)
gpm_stop && sleep 3
gpm_start || exit 1
;;
*)
echo "Usage: /etc/init.d/gpm {start|stop|restart|force-reload|strace}"
exit 1
esac
exit 0
|