/etc/init.d/ibmasm is in ibmasm-utils 3.0-1ubuntu12.
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 | #! /bin/bash
### BEGIN INIT INFO
# Provides: ibmasm
# Required-Start: $network $local_fs $remote_fs
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Start/Stop ibmasm driver.
### END INIT INFO
# Source function library.
. /lib/lsb/init-functions
RETVAL=0
prog=ibmsphalt
pidfile="/var/run/ibmsphalt.pid"
lockfile="/var/lock/subsys/ibmasm"
start() {
# Make sure the module (ibmasm) is loaded and its fs is exported.
if grep -v -q ibmasmfs /proc/filesystems; then
modprobe ibmasm || exit 1
fi
log_action_msg "Waiting for ibmasm device to appear (2 seconds timeout)"
TIMEOUT=2
for ((i=0; i<$TIMEOUT; i++)); do
DEVICE=`/usr/bin/evnode -n "ibmasm RSA I remote mouse"`
if [ ! -z $DEVICE ]; then
TIMEOUT="ok"
break;
fi
echo -n ". "
sleep 1
done
# Check the timeout. If not changed, then no device found.
if [ $TIMEOUT == "10" ]; then
log_action_msg "No device detected. Aborted."
return 1
fi
}
stop() {
echo -n $"Stopping ibmasm: "
/sbin/ibmspdown && rm -f /var/log/subsys/ibmasm
}
restart() {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
reload|restart|force-reload)
restart
;;
status)
status $prog
RETVAL=$?
;;
condrestart)
[ -f $lockfile ] && restart || :
;;
*)
echo $"Usage: $0 {start|stop|status|restart|force-reload|condrestart}"
exit 1
esac
|