On Fri, 4 Apr 2008, j.chitte wrote:
> Check out restarting inetd :
>
> $ ./rc.inetd restart
>
> Sending SIGHUP to inetd
>
>
> 61 root 680 S /usr/sbin/inetd 27134 root 560 S /bin/sh ./rc.inetd
> restart 27138 root 564 S /bin/sh ./rc.inetd restart 27140 root 464 S
> grep inetd
>
> kill: Bad PID 'root'
> $
>
> Can someone with a TS72xx using original busybox care to confirm that?
I'm not using the original busybox, my version is BusyBox v1.00-rc3
(2006.02.20-14:02+0000). It displays the broken awk symptoms. I'm not a big
awk user (using "cut" for most of the awk uses I've seen here), so have
never hit this problem, and it's the first time I've looked at the
/etc/init.d/rc.inetd script...
Which not only is buggy because of the broken awk, but is buggy in other
ways - restart attempts to HUP inetd, then starts another instance of
inetd! You end up with multiple (redundant) inetd's running. If you have
syslogd running you do see the new inetd's complaining about ports already
in use.
If anyone is interested, a better version of /etc/init.d/rc.inetd is
appended. This does start|stop|restart|kick and uses cut instead of awk.
cheers
Jim
#!/bin/sh
#
# /etc/init.d/rc.inetd used to start/stop/restart/kick the inetd daemon
#
OPTIONS=""
case "$1" in
start)
echo -n "Starting inetd (pid "
/sbin/inetd $OPTIONS
l=`ps -ax |grep inetd`
pid=$(echo $l | cut -d' ' -f1)
echo "$pid) ..."
;;
stop)
echo -n "Stopping inetd (pid "
l=`ps -ax |grep inetd`
pid=$(echo $l | cut -d' ' -f1)
echo "$pid) ..."
kill -TERM $pid
;;
kick|HUP|hup)
echo ""
echo -n "Sending SIGHUP to inetd (pid "
l=`ps -ax |grep inetd`
pid=$(echo $l | cut -d' ' -f1)
echo "$pid) ..."
kill -SIGHUP $pid
;;
restart)
$0 stop
$0 start
;;
*)
echo "usage: start|stop|restart|kick|hup"
;;
esac
------------------------------------
Yahoo! Groups Links
<*> To visit your group on the web, go to:
http://groups.yahoo.com/group/ts-7000/
<*> Your email settings:
Individual Email | Traditional
<*> To change settings online go to:
http://groups.yahoo.com/group/ts-7000/join
(Yahoo! ID required)
<*> To change settings via email:
<*> To unsubscribe from this group, send an email to:
<*> Your use of Yahoo! Groups is subject to:
http://docs.yahoo.com/info/terms/
|