[syslog-ng]Re: Thinking about linking
Balazs Scheidler
bazsi@balabit.hu
Thu, 27 Jun 2002 11:27:05 +0200
On Thu, Jun 27, 2002 at 09:03:56AM +0200, Jay Goldberg wrote:
> Hi Klaas
>
> Thanks very much for the reply and for thinking that this makes sense :)
>
> Symlinks are really portable - the symlink() and unlink() system calls are
> part of the Open Group's UNIX 98 definition (formerly X/Open and 'Spec
> 1170'),
> so any UNIX would be able to do this. Less sure about windows, BTW,
> although
> Cygwin and U/WIN definitely do support the calls.
>
> If I can find the time, I'll have a look at it myself, as I think it's
> really just a few lines of logic (plus error checking et al):
>
> add file options "symlink_cur" and "symlink_pre"
>
> at file close() time:
> if (symlink_cur is set) {
> unlink(symlink_cur)
> }
> if (symlink_pre is set) {
> symlink(real_file, symlink_pre)
> }
>
> at file open() time:
>
> if (symlink_cur is set) {
> symlink(real_file, symlink_cur)
> }
>
> ...that should about cover it. Never having touched lex & yacc, I've been
> hesitant to try to touch this code, but it shouldn't be that bad (famous
> last words :))
The problem with the feature outlined above is that syslog-ng doesn't know
the notion of 'last' file. It can write to several files in parallel.
Imagine a destination /var/log/messages/$PROGRAM, where each program has its
own file.
--
Bazsi
PGP info: KeyID 9AF8D0A9 Fingerprint CD27 CFB0 802C 0944 9CFD 804E C82C 8EB1