:: Re: [DNG] logging uses of machine-i…
Forside
Slet denne besked
Besvar denne besked
Skribent: Didier Kryn
Dato:  
Til: dng
Emne: Re: [DNG] logging uses of machine-id
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.

    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