Re: Recording usage without write permission

"Michael F. Stemper" <[email protected]> Wed, 18 Oct 2023 08:23:54 -0500
Newsgroups alt.comp.lang.shell.unix.bourne-bash
Organization A noiseless patient Spider
Message-ID <[email protected]>
On 16/10/2023 12.39, David W. Hodgins wrote:
> On Mon, 16 Oct 2023 09:44:59 -0400, Michael F. Stemper <[email protected]> wrote:
>> But, I'm curious as to whether there is some way to accomplish the
>> same thing without giving promiscuous access to a file in my user
>> space. Maybe some kind of messaging? Send a message to a daemon
>> executing as me, and have that do the reading and writing? Some
>> other method?
> 
> That's exactly how rsyslog and systemd-journald work. They each use a
> daemon that runs as root the records the log entries. Whether or not
> the user has read access depends on what groups the user is a member
> of.
> 
> With systemd-journald, it supports both system and user level journal
> entries.

Thanks.

Looking at the man page for systemd-journald, I see the following:

   By default, each logged in user will get her/his own set of journal
   files in /var/log/journal/.

Does this mean that logging would only work when I was logged in, and that
all of the journal files would disappear when I logged out? Or, would the fact
that my daemon was running (or lurking) count as me being logged in?

Although after reading that man page, I also realized that the daemon approach
probably would not have been practical for me. There were somewhere between
forty and fifty boxes on that network. I would have needed to kick off a
daemon on each of them, and also set up something to gather the results from
each box's /var/log/journal/ to a common location (my $HOME).

None the less, interesting new knowledge.

-- 
Michael F. Stemper
Isaiah 58:6-7