:: Re: [DNG] logging uses of machine-i…
Página Inicial
Delete this message
Reply to this message
Autor: Arnt Karlsen
Data:  
Para: dng
Assunto: Re: [DNG] logging uses of machine-id
On Mon, 11 Mar 2019 17:43:45 +0100, Didier wrote in message
<bfb84211-9e16-dc18-c2d2-d7e6a19416e0@???>:

> Le 11/03/2019 à 17:22, Arnt Karlsen a écrit :
> > On Mon, 11 Mar 2019 15:47:57 +0100, Didier wrote in message
> > <d6d284f7-9e08-95ec-f4ca-67c3754b9b06@???>:
> >
> >> Le 11/03/2019 à 15:32, Didier Kryn a écrit :
> >>> The invocation syntax to watch machine-id is
> >>> 'fawatch /var/lib/machine-id'
> >> Erratum:
> >>
> >> The invocation syntax to watch machine-id is 'fawatch
> >> /var/lib/dbus/machine-id'
> > ..and 'fawatch /etc/machine-id' if watching both (with 2 separate
> > invocations)?
> >
> > ..or will it do 'fawatch /var/lib/dbus/machine-id /etc/machine-id'
> > in one process?
> >
> > ..and _should_ it watch all these ID files off one process, or,
> > off one invocation per ID file?
> > (Policy, rather than a tech question.)
> >
> >
>     fawatch can only watch one file, for two reasons: the first is I
> didn't think of watching more, and the second is that I don't know
> how to know which file was opened if there are more than one. But you
> can launch as many instances of the program as you want.


..ah ok, and I agree as a matter of policy.

>     When a process wants to open the watched file, it is suspended
> until fawatch grants it the permission to proceed.
>
>     Before granting permission, fawatch retrieves the pid of the
> process, its command line and its owner - otherwise, very fast
> applications (eg cat) may be finished before fawatch can retrieve
> these data.
>
>     The command, process-id and owner are logged on stdout. Errors
> are reported on stderr. I would recommend to send error messages to
> the same output as the logs. eg 'fawatch /var/lib/dbus/machine-id
> >/var/log/machine-id.log 2>&1 &'
>
>         Didier


..hum, a .deb idea, maybe put a list of files to watch in 
/etc/defaults/fawatch , so /etc/rcS.d/S01fawatch can do 
e.g.: 'for F in $(cat /etc/defaults/fawatch) ;do fawatch \
    $F >/var/log/machine-id.d/$F.log 2>&1 & ;done ' ?





--
..med vennlig hilsen = with Kind Regards from Arnt Karlsen
...with a number of polar bear hunters in his ancestry...
Scenarios always come in sets of three:
best case, worst case, and just in case.