I've played around with heartbeat for some days now and found some strang=
e =
behaviour. For testing I use httpd as my resource, so heartbeat starts th=
e =
httpd process when it comes up. The problem is: the httpd process kind of=
=
inherits the udp-socket used for the exchange of the heartbeats. This is =
not a =
problem if everything goes fine and heartbeat is taken down with =
/etc/rc.d/init.d/heartbeat stop, because in this case also httpd is taken=
down =
and the socket is free. But if for some reason heartbeat dies without tak=
ing =
httpd down (e.g. kill -9) the socket (1001) can still be found allocated =
for =
httpd (do a socklist | grep 1001) and heartbeat refuses to start up again=
=
(because it can't open a socket on port 1001).
I solved this problem by setting the close-on-exec bit for the socket in =
udp.c =
using fcntl(). It looks as if I didn't destroy anything else with this ch=
ange =
and it works fine now for me.
If you like I can send you a patch (or do you disagree with my changes?)
Christoph
-- =
Christoph J=E4ger mailto:cja@gams.at
g.a.m.s. edv dienstleistungen gmbh +43 1 895 84 99-25
stiegergasse 15-17 ; 1150 Wien http://www.gams.at =
e =
behaviour. For testing I use httpd as my resource, so heartbeat starts th=
e =
httpd process when it comes up. The problem is: the httpd process kind of=
=
inherits the udp-socket used for the exchange of the heartbeats. This is =
not a =
problem if everything goes fine and heartbeat is taken down with =
/etc/rc.d/init.d/heartbeat stop, because in this case also httpd is taken=
down =
and the socket is free. But if for some reason heartbeat dies without tak=
ing =
httpd down (e.g. kill -9) the socket (1001) can still be found allocated =
for =
httpd (do a socklist | grep 1001) and heartbeat refuses to start up again=
=
(because it can't open a socket on port 1001).
I solved this problem by setting the close-on-exec bit for the socket in =
udp.c =
using fcntl(). It looks as if I didn't destroy anything else with this ch=
ange =
and it works fine now for me.
If you like I can send you a patch (or do you disagree with my changes?)
Christoph
-- =
Christoph J=E4ger mailto:cja@gams.at
g.a.m.s. edv dienstleistungen gmbh +43 1 895 84 99-25
stiegergasse 15-17 ; 1150 Wien http://www.gams.at =