#!/bin/sh ### BEGIN INIT INFO # Provides: i8kmon # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Should-Start: $local_fs # Should-Stop: $local_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Dell fan/cpu-temperature monitor # Description: Enable service provided by daemon ### END INIT INFO # i8kmon Dell fan/cpu-temperature monitor # # Written by Miquel van Smoorenburg . # Modified for Debian GNU/Linux # by Ian Murdock . # # Modified for i8kutils by Karl E. Jørgensen , # Massimo Dal Zotto and # Bradley Smith # Updated by Vitor Augusto . PATH=/sbin:/bin:/usr/sbin:/usr/bin . /lib/lsb/init-functions NAME=i8kmon DAEMON=/usr/bin/i8kmon PROC_I8K=/proc/i8k DESC="Dell fan/cpu-temperature monitor" I8KMON_ARGS="--daemon --nouserconfig --auto" PIDFILE=/var/run/$NAME.pid test -x $DAEMON || exit 5 if [ -f /etc/default/$NAME ] ; then . /etc/default/$NAME fi case "$1" in start) log_daemon_msg "Starting $DESC" "$NAME" modprobe i8k >/dev/null 2>&1 || true if [ ! -f "$PROC_I8K" ]; then log_progress_msg "Could not find $PROC_I8K." log_end_msg 1 exit 1 fi start-stop-daemon --start --quiet --pidfile $PIDFILE \ --background --make-pidfile --startas $DAEMON -- $I8KMON_ARGS log_end_msg $? ;; stop) log_daemon_msg "Stopping $DESC" "$NAME" start-stop-daemon --oknodo --stop --quiet --pidfile $PIDFILE log_end_msg $? rm -f $PIDFILE ;; status) status_of_proc -p $PIDFILE $DAEMON $NAME ;; restart|reload|force-reload) $0 stop && sleep 2 && $0 start ;; *) echo "Usage: $0 {start|stop|status|restart|reload|force-reload}" >&2 exit 2 ;; esac