On Mon, Jan 21, 2013 at 08:55:22AM +0100, Ulrich Windl wrote:
> >>> Vadym Chepkov <[email protected]> schrieb am 19.01.2013 um 22:44 in
> >>> Nachricht
> <[email protected]>:
>
> > Hi,
> >
> > I stumbled upon a bug in agent Xinetd after upgrading to 3.9.3.
> >
> > The problem is with this command
> >
> > ps -e -o pid,command | $AWK '$2 ~ /\/[x]inetd/ { print $1 }'
> >
> > On Centos 5.9 it doesn't determine pid of the running xinetd process
> >
> > # ps -e -o pid,command | grep xinetd
> > 4302 xinetd -stayalive -pidfile /var/run/xinetd.pid
> >
> > First of all, I think comm option should be used instead of command:
> >
> > # ps -e -o pid,comm | grep xinetd
> > 4302 xinetd
> >
> >
> > I ended up with the following fix :
> >
> > diff --git a/heartbeat/Xinetd b/heartbeat/Xinetd
> > index 957a379..637077f 100755
> > --- a/heartbeat/Xinetd
> > +++ b/heartbeat/Xinetd
> > @@ -79,7 +79,7 @@ END
> > hup_inetd () {
> > # don't rely on the pid file, but lookup xinetd in the list of
> > # processes
> > - pid=`ps -e -o pid,command | $AWK '$2 ~ /\/[x]inetd/ { print $1 }'`
> > + pid=`ps -e -o pid,comm | $AWK '$2 ~ /[x]inetd/ { print $1 }'`
>
> Hi!
>
> Shouldn't hat be "/^[x]inetd$/"? Imagin a process named "fixinetdaemon"...
That would actually be:
> > + pid=`ps -e -o pid,comm | $AWK '$2 == "xinetd" { print $1 }'`
Thanks,
Dejan
> There are much fewer ways to do it right than to do it wrong...
>
> Regards,
> Ulrich
>
>
> > if [ "$pid" ]; then
> > if kill -s HUP $pid; then
> > ocf_log info "asked xinetd to reload by sending SIGHUP to
> > process $pid!"
> >
> >
> >
> > Regards,
> > Vadym
> >
> > _______________________________________________
> > Linux-HA mailing list
> > [email protected]
> > http://lists.linux-ha.org/mailman/listinfo/linux-ha
> > See also: http://linux-ha.org/ReportingProblems
> >
>
>
>
>
> _______________________________________________
> Linux-HA mailing list
> [email protected]
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems
_______________________________________________
Linux-HA mailing list
[email protected]
http://lists.linux-ha.org/mailman/listinfo/linux-ha
See also: http://linux-ha.org/ReportingProblems