6 [ -f /etc
/conf.d
/cdpolld
] && .
/etc
/conf.d
/cdpolld
8 DEVLIST
=${DEVLIST:-/dev/sr0}
12 PIDFILE
="/var/run/`basename $0`.pid"
14 touch $PIDFILE &>/dev
/null
15 [ $?
-gt 0 ] && return 1
18 trap "rm -f $PIDFILE;return 0" 0 &>/dev
/null
19 trap "rm -f $PIDFILE;return 0" SIGINT
&>/dev
/null
20 trap "rm -f $PIDFILE;return 0" SIGQUIT
&>/dev
/null
21 trap "rm -f $PIDFILE;return 0" SIGKILL
&>/dev
/null
22 trap "rm -f $PIDFILE;return 0" SIGTERM
&>/dev
/null
24 pidof
-o $SELFPID -x $0 >$PIDFILE
25 [ $?
-gt 0 ] && return 1
27 for DEV
in "${DEVLIST[@]}"; do
37 stat_busy
"Starting cdpolld"
38 PID
=`pidof -x -o %PPID cdpolld`
39 [ -z $PID ] && poll_daemon
49 stat_busy
"Stopping cdpolld"
50 PID
=`pidof -x -o %PPID cdpolld`
51 [ ! -z $PID ] && kill $PID &>/dev
/null
63 restart
) stop
; sleep 2; start
;;
64 *) echo "usage: $0 {start|stop|restart}";;