[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

start-stop-daemon: stop several processes



Hi,

There are 2 systems behind a Thomson TG585V8 router connected to the internet.

Currently about once every halfhour the 'internet' LED on the router goes out (no internet connection) then goes red (internet connection failed) and goes green again. Takes 3-5 mins.

On my desktop this is noticed by ddclient which sees a change in the external IP and behaves accordingly.

Because I am interested in recording these events, like this:

Tue Jan 10 08:19:51 2012 189.188.155.144 (226)
Tue Jan 10 08:49:52 2012 189.188.157.21 (226)
Tue Jan 10 09:29:54 2012 187.132.137.81 (226)
Tue Jan 10 10:14:57 2012 187.136.116.91 (226)

I wrote a program 'do_chk_ip' which is piped the tail of syslog and looks for the appropriate ddclient message and then records the date and time to a database.

This process is started at boot by 'do_chk_ip' in /etc/init.d which has:

  stop)
    start-stop-daemon --stop --verbose --exec $DAEMON
    ;;

where $DAEMON=/usr/bin/do_tail_chk which has:

tail -s 1 -n 60 -f /var/log/syslog | /usr/bin/do_chk_ip

but that starts 3 processes:

28739 tty5     00:00:00 do_tail_chk
28740 tty5     00:00:00 tail
28741 tty5     00:00:00 do_chk_ip

My stop) statement only kills 28739, how do I specify that also 28740 and 28741 ought to be killed?

Hugo


Reply to: