Mailing List Archive

heartbeat bug?
Hello

When doing a /etc/rc.d/init.d/heartbeat stop it fails to remove the
lock file /var/lock/LCK..ttyS0. So starting it again will fail. It
looks as if the function serial_close() is never called.

This happens with heartbeat-0.4.7 on RH6.1.

Regards,
Holger
heartbeat bug? [ In reply to ]
--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii

On Sat, Apr 15, 2000 at 01:32:20PM +0200, Holger Kiehl wrote:
> Hello
>
> When doing a /etc/rc.d/init.d/heartbeat stop it fails to remove the
> lock file /var/lock/LCK..ttyS0. So starting it again will fail. It
> looks as if the function serial_close() is never called.
>
> This happens with heartbeat-0.4.7 on RH6.1.

There is a bug in 0.4.7 that will be fixed in the next relese.
A patch for this problem is attached.



--
Horms

--azLHFNyN32YCQGCU
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="serial.c.ttylock.patch"

--- serial.c.orig Tue Apr 11 15:10:27 2000
+++ serial.c Tue Apr 11 15:12:22 2000
@@ -1,4 +1,4 @@
-const static char * _serial_c_Id = "$Id: serial.c,v 1.11 2000/02/23 18:44:53 alan Exp $";
+const static char * _serial_c_Id = "$Id: serial.c,v 1.12 2000/04/11 22:12:22 horms Exp $";

/*
* Linux-HA serial heartbeat code
@@ -202,7 +202,7 @@
if (sscanf(buf, "%d", &pid) < 1) {
/* lockfile screwed up -> rm it and go on */
} else {
- if (kill(pid, 0) != ESRCH) {
+ if (kill(pid, 0)==-1 && errno != ESRCH) {
/* tty is locked by existing (not
* necessarily running) process
* -> give up */
@@ -521,6 +521,9 @@
}
/*
* $Log: serial.c,v $
+ * Revision 1.12 2000/04/11 22:12:22 horms
+ * Now cleans locks on serial devices from dead processes succesfully
+ *
* Revision 1.11 2000/02/23 18:44:53 alan
* Put in a bug fix from Cliff Liang <lqm@readworld.com> to fix the tty
* locking code. The parameters to sscanf were mixed up.

--azLHFNyN32YCQGCU--
heartbeat bug? [ In reply to ]
On Sat, 15 Apr 2000, Horms wrote:

> On Sat, Apr 15, 2000 at 01:32:20PM +0200, Holger Kiehl wrote:
> > Hello
> >
> > When doing a /etc/rc.d/init.d/heartbeat stop it fails to remove the
> > lock file /var/lock/LCK..ttyS0. So starting it again will fail. It
> > looks as if the function serial_close() is never called.
> >
> > This happens with heartbeat-0.4.7 on RH6.1.
>
> There is a bug in 0.4.7 that will be fixed in the next relese.
> A patch for this problem is attached.
>
Thanks, for the VERY quick help!

Holger
heartbeat bug? [ In reply to ]
Holger Kiehl wrote:
>
> On Sat, 15 Apr 2000, Horms wrote:
>
> > On Sat, Apr 15, 2000 at 01:32:20PM +0200, Holger Kiehl wrote:
> > > Hello
> > >
> > > When doing a /etc/rc.d/init.d/heartbeat stop it fails to remove the
> > > lock file /var/lock/LCK..ttyS0. So starting it again will fail. It
> > > looks as if the function serial_close() is never called.
> > >
> > > This happens with heartbeat-0.4.7 on RH6.1.
> >
> > There is a bug in 0.4.7 that will be fixed in the next relese.
> > A patch for this problem is attached.
> >
> Thanks, for the VERY quick help!

You got lucky! Horms had already put the fix under CVS :-)

-- Alan Robertson
alanr@suse.com