pcp
[Top] [All Lists]

Re: pmnewlog quirk

To: Nathan Scott <nscott@xxxxxxxxxx>
Subject: Re: pmnewlog quirk
From: Ken McDonell <kenj@xxxxxxxxxxxxxxxx>
Date: Mon, 02 Mar 2009 17:38:04 +1100
Cc: pcp@xxxxxxxxxxx
In-reply-to: <1235961800.4257.41.camel@xxxxxxxxxxxxxxxxxx>
References: <1235961800.4257.41.camel@xxxxxxxxxxxxxxxxxx>
Reply-to: kenj@xxxxxxxxxxxxxxxx
INT then HUP then KILL is sort of in order of increasing urgency for
apps in general ... I don't think this was ever tailored for pmlogger.

HUP should not be there for pmlogger.

The only flushing is stdio buffer flushing ... if this will safely get
done on exit in all environments, then you don't need USR1, as INT and
KILL will suffice.  If that is not the case, the order USR1, INT and
KILL you suggest would be correct.

On Mon, 2009-03-02 at 13:43 +1100, Nathan Scott wrote:
> Hi Ken,
> 
> I came across a slight oddity in pmnewlog - it has code like this:
> 
> ...
> # kill off existing pmlogger
> #
> $VERBOSE && $PCP_ECHO_PROG $PCP_ECHO_N "Terminating
> $myname ...""$PCP_ECHO_C"
> for sig in INT HUP KILL
> do
>     $VERBOSE && $PCP_ECHO_PROG $PCP_ECHO_N " SIG$sig ...""$PCP_ECHO_C"
>     eval $KILL -s $sig $pid
>     sleep 5
>     [ "`_check_pid $pid`" = "" ] && break
> done
> 
> 
> Now SIGHUP is "start a new volume" in pmlogger, SIGINT is "exit".
> Is that SIGHUP supposed to be there?  Seems pretty random as to
> whether it will ever get called.  Should we flush first?  (SIGUSR1)
> Was that the original intention there?  SIGINT just unlinks control
> files and then exits... seems like maybe we should do an flush too?
> (IOW should I change the signal list to "flush, exit, force-exit"?)
> 
> Thanks!
> 
> --
> Nathan
> 

<Prev in Thread] Current Thread [Next in Thread>