Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 19 May 1999 11:48:01 +0200
From:      Marcel Moolenaar <marcel@scc.nl>
To:        hm@hcs.de
Cc:        isdn@FreeBSD.ORG
Subject:   Re: Rename on SIGUSR1 for isdnd
Message-ID:  <374288D1.8D3F25DD@scc.nl>
References:  <m10k0sp-0000fgC@hcswork.hcs.de>

next in thread | previous in thread | raw e-mail | index | archive | help
Hellmuth Michaelis wrote:
> 
> >From the keyboard of Marcel Moolenaar:
> 
> > Below is a small set of patches to change the behaviour of isdnd when it's
> > send a SIGUSR1 signal. Without the patches, isdnd simply closes and reopens
> > the acctfile and logfile (if applicable). With the patches, isdnd closes the
> > files and renames them, after which fresh files are created.
> 
> The idea behind isdnd's current behaviour is to have a shell script which
> renames isdnd's log file and then send a SIGUSR1 signal to isdnd.
> 
> The advantage i see with that approach is, that the new name of the logfiles
> is freely choosable whereas the patch has hardcoded names which are not
> available to a shell script (if the name in isdnd changes, the script has
> to be modified).
> 
> On the other side, the advantage of the patch is that the rename is under
> control of isdnd which makes it (more) atomic.
> 
> Comments ?
> 

The shell script has to be modified in both cases when the filename changes,
so that's not particularly disadvanteous for one method.

The reason for the patch is more "emotional" than technical. Firstly, I don't
like fiddling with things that are under the control of running programs. It
makes matters more complicated than strictly necessary. Secondly, I like
clear functionality. Closing and reopening files makes sense only when
accompanied by some external (from the isdnd point of view) action. The
feature of closing and reopening files is *on itself* not meaningful. It is
also implementation specific. By adding a simple rename, the clear
functionality is there without any external event and is meaningful in any
implementation.

The advantage of doing the rename by isdnd is that the shell script only has
to consider one file (namely isdn.acct.last) and that the script can do with
it as it pleases. When the rename is done by the shell script, it has to
consider 2 files (namely isdn.acct and the one to which it is renamed), of
which one can change at any time. There is clearly a differency in complexity
and the increase of complexity in isdnd is far less than the decrease of
complexity in the shell script...

marcel


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-isdn" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?374288D1.8D3F25DD>