Daemonologists wanted
If I issue
/etc/init.d/sensord start
to start the sensor daemon, the script seems to run fine, but the daemon
doesn't actually start. On my other machines, it runs as expected. Any
daemonologists out there?
Dave
#!/bin/sh -xv
PATH=/bin:/usr/bin:/sbin:/usr/sbin
+ PATH=/bin:/usr/bin:/sbin:/usr/sbin
DAEMON=/usr/sbin/sensord
+ DAEMON=/usr/sbin/sensord
# PIDFILE=/var/run/sensord.pid
CONFIG=/etc/default/sensord
+ CONFIG=/etc/default/sensord
test -x $DAEMON || exit 0
+ test -x /usr/sbin/sensord
if [ -f $CONFIG ]; then . $CONFIG; fi
+ '[' -f /etc/default/sensord ']'
+ . /etc/default/sensord
# Interval between scanning for alarms; e.g., 30s, 1m, 1h
ALARM_INTERVAL=30m
++ ALARM_INTERVAL=30m
# Interval between logging sensor measurements; e.g., 30s, 1m, 1h
LOG_INTERVAL=1h
++ LOG_INTERVAL=1h
# Syslog facility to use
SYSLOG_FACILITY=daemon
++ SYSLOG_FACILITY=daemon
# Libsensors config file to use
# CONFIG_FILE=/etc/sensors.conf
# Chips to scan
# SCAN_CHIPS=...
# Uncomment this to enable a 7-day round-robin database of sensor
# readings. See the ROUND ROBIN DATABASES section of the sensord
# manual page for details.
# RRD_FILE=/var/log/sensord.rrd
# Interval between RRD readings; e.g. 30s, 5m (default), 1h
# RRD_INTERVAL=5m
# Include the load average in the RRD file. If you enable this you
# must remove your old RRD file and rebuild your CGI script.
# RRD_LOADAVG=yes
if [ -n "$ALARM_INTERVAL" ]; then ALARM_INTERVAL="-i $ALARM_INTERVAL"; fi
+ '[' -n 30m ']'
+ ALARM_INTERVAL='-i 30m'
if [ -n "$LOG_INTERVAL" ]; then LOG_INTERVAL="-l $LOG_INTERVAL"; fi
+ '[' -n 1h ']'
+ LOG_INTERVAL='-l 1h'
if [ -n "$SYSLOG_FACILITY" ]; then SYSLOG_FACILITY="-f $SYSLOG_FACILITY"; fi
+ '[' -n daemon ']'
+ SYSLOG_FACILITY='-f daemon'
if [ -n "$CONFIG_FILE" ]; then CONFIG_FILE="-c $CONFIG_FILE"; fi
+ '[' -n '' ']'
if [ -n "$RRD_FILE" ]; then RRD_FILE="-r $RRD_FILE"; fi
+ '[' -n '' ']'
if [ -n "$RRD_INTERVAL" ]; then RRD_INTERVAL="-t $RRD_INTERVAL"; fi
+ '[' -n '' ']'
if [ -n "$RRD_LOADAVG" ]; then RRD_LOADAVG="-a"; fi
+ '[' -n '' ']'
case "$1" in
start)
echo -n "Starting sensor daemon:"
echo -n " sensord"
if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON --name
sensord
then
echo " already running."
exit
fi
/sbin/start-stop-daemon --start --quiet --exec $DAEMON -- $ALARM_INTERVAL
$LOG_INTERVAL $SYSLOG_FACILITY $RRD_INTERVAL $RRD_FILE $RRD_LOADAVG
$CONFIG_FILE $SCAN_CHIPS
echo "."
;;
stop)
echo -n "Stopping sensor daemon: sensord"
if start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON --name
sensord
then
start-stop-daemon --quiet --stop --exec $DAEMON --name sensord
# Now we wait for it to die
# while kill -0 $PID 2>/dev/null; do sleep 1; done
while start-stop-daemon --quiet --stop --signal 0 --exec $DAEMON --name
sensord 2>/dev/null; do sleep 1; done
echo "."
else
echo " not running.";
fi
;;
force-reload|restart)
$0 stop
$0 start
;;
*)
echo "Usage: /etc/init.d/sensord {start|stop|restart|force-reload}"
exit 1
esac
+ case "$1" in
+ echo -n 'Starting sensor daemon:'
Starting sensor daemon:+ echo -n ' sensord'
sensord+ start-stop-daemon --quiet --stop --signal
0 --exec /usr/sbin/sensord --name sensord
+ /sbin/start-stop-daemon --start --quiet --exec /usr/sbin/sensord -- -i
30m -l 1h -f daemon
+ echo .
.
exit 0
+ exit 0
root@chianti:/etc#
Reply to: