Demo Discussion
Forum Config Examples Contributions Vulnerabilities
  Discussion forum about ELOG  Not logged in ELOG logo
icon8.gif   elogd dies after receiving second SIGHUP, posted by Kester Habermann on Tue Nov 11 16:45:04 2008 
    icon2.gif   Re: elogd dies after receiving second SIGHUP, posted by Stefan Ritt on Mon Nov 17 10:27:23 2008 
       icon2.gif   Re: elogd dies after receiving second SIGHUP, posted by Paul T. Keener on Wed Jun 3 19:53:13 2009 
          icon2.gif   Re: elogd dies after receiving second SIGHUP, posted by Stefan Ritt on Thu Jun 4 09:49:13 2009 
             icon2.gif   Re: elogd dies after receiving second SIGHUP, posted by Paul T. Keener on Thu Jun 4 18:49:29 2009 elogd-signal.patch
                icon2.gif   Re: elogd dies after receiving second SIGHUP, posted by Stefan Ritt on Fri Jun 5 13:18:00 2009 
Message ID: 66377     Entry time: Thu Jun 4 18:49:29 2009     In reply to: 66368     Reply to this: 66382
Icon: Reply  Author: Paul T. Keener  Author Email: keener@hep.upenn.edu 
Category: Bug report  OS: Other  ELOG Version: 2.7.5 
Subject: Re: elogd dies after receiving second SIGHUP 
> > > > elogd continues to run after a SIGHUP. If a second SIGHUP is received the daemon terminates.
> > > > This was observed on Solaris 10 (SPARC).
> > > > The documentation states that elogd should re-read configuration after receiving SIGHUP.
> > > 
> > > I tried to reproduce this but without success. I could send many SIGHUPs without the daemon terminating. Maybe 
> > > you modified the configuration file in between and elogd barked out because of some wrong configuration? Try to 
> > > start the daemon interactively and see what exactly happens if you send several SIGHUPs.
> > 
> > The problem is that under Solaris signal handlers installed via signal() get uninstalled *before* the signal handler
> > is called.  Thus the second time elogd receives a SIGHUP, you get the default action, which is to kill the process.
> > 
> > The solution is to use the POSIX sigaction() call instead of signal(). 
> 
> Can you try to modify the signal() calls into sigaction(). If this really works under Solaris, I will incorporate this 
> then into the distribution.

Here is the patch.  It works under both Solaris and Linux.
Attachment 1: elogd-signal.patch  1 kB  | Show | Show all
ELOG V3.1.5-3fb85fa6