[Linux-HA] socket of lrmd

Dejan Muhamedagic dejanmm at fastmail.fm
Fri Jul 3 01:28:20 MDT 2009


Hi again Junko-san,

On Fri, Jul 03, 2009 at 04:15:40PM +0900, Junko IKEDA wrote:
> Hi,
> 
> On Fri, 03 Jul 2009 10:59:21 +0900, Junko IKEDA <ikedaj at intellilink.co.jp> wrote:
> 
> > Hi Dejan,
> >
> > Your patch could stop the error message from LVM RA.
> > Many thanks!
> > But I run Heartbeat 2.1.4 so I worry about whether 2.1.4 still have a problem about stonithd that you pointed.
> >
> > By the way, does closefiles() close both of the connections for syslogd and ha_logd ?
> 
> The patch works well.
> but, what will happen if we don't use it?

There will be an unused file open.

> It seems that lrmd keeps the file descriptor (3) for
> ha_logd/syslogd while running.

Right.

> Will the number of the file descriptor reach its max limit without this patch?

No, there's always only one connection. That's inherited from the
parent process.

Thanks,

Dejan

> 
> Thanks,
> Junko
> 
> >
> > On Thu, 02 Jul 2009 22:04:06 +0900, Dejan Muhamedagic <dejanmm at fastmail.fm> wrote:
> >
> >> Hi,
> >>
> >> On Thu, Jul 02, 2009 at 06:40:26PM +0900, Junko IKEDA wrote:
> >>> Hi,
> >>>
> >>> I try to strace of lrmd.
> >>>
> >>> (1) running syslog, and strace
> >>> # service syslog start
> >>> # strace -o /tmp/strace-syslog-start.txt /usr/lib64/heartbeat/lrmd -rv
> >>>
> >>> socket(PF_FILE, SOCK_DGRAM, 0)          = 3
> >>> fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
> >>> connect(3, {sa_family=AF_FILE, path="/dev/log"...}, 110) = 0
> >>> sendto(3, "<30>Jul  2 17:02:46 lrmd: [16211"..., 102, MSG_NOSIGNAL, NULL, 0) = 102
> >>>
> >>> (2) stop syslog and strace
> >>> # service syslog stop
> >>> # strace -o /tmp/strace-syslog-stop.txt /usr/lib64/heartbeat/lrmd -rv
> >>>
> >>> socket(PF_FILE, SOCK_DGRAM, 0)          = 3
> >>> fcntl(3, F_SETFD, FD_CLOEXEC)           = 0
> >>> connect(3, {sa_family=AF_FILE, path="/dev/log"...}, 110) = -1 ENOENT (No such file or directory)
> >>> close(3)                                = 0
> >>> open("/dev/console", O_WRONLY|O_NOCTTY) = 3
> >>>
> >>> (for more details, see the attached files)
> >>>
> >>> Is the socket of lrmd for syslog?
> >>> wild guess?
> >>
> >> Right. See lib/lrm/racommon.c:closefiles(). I must say I can't
> >> remember why exactly was the connection to syslogd/ha_logd
> >> needed. There has been a problem with stonithd, but now this code
> >> is not in that execution path anymore. Perhaps you can test this
> >> patch:
> >>
> >> diff -r 731f8f7b5450 lib/lrm/racommon.c
> >> --- a/lib/lrm/racommon.c        Tue Jun 30 12:02:16 2009 +0200
> >> +++ b/lib/lrm/racommon.c        Thu Jul 02 15:02:55 2009 +0200
> >> @@ -145,7 +145,7 @@
> >>
> >>         /* close all descriptors except stdin/out/err and
> >>  * channels to logd */
> >>         for (fd = getdtablesize(); fd > STDERR_FILENO; fd--) {
> >> -               if (!cl_log_is_logd_fd(fd))
> >> +               /*if (!cl_log_is_logd_fd(fd))*/
> >>                         close(fd);
> >>         }
> >>  }
> >>
> >> Thanks,
> >>
> >> Dejan
> 
> _______________________________________________
> Linux-HA mailing list
> Linux-HA at lists.linux-ha.org
> http://lists.linux-ha.org/mailman/listinfo/linux-ha
> See also: http://linux-ha.org/ReportingProblems



More information about the Linux-HA mailing list