Arch Linux

Please read this before reporting a bug:
https://wiki.archlinux.org/title/Bug_reporting_guidelines

Do NOT report bugs when a package is just outdated, or it is in the AUR. Use the 'flag out of date' link on the package page, or the Mailing List.

REPEAT: Do NOT report bugs for outdated packages!
Tasklist

FS#74500 - [systemd] does systemd.install need to create /var/log/journal/remote/ ?

Attached to Project: Arch Linux
Opened by Damjan Georgievski (damjan) - Monday, 18 April 2022, 21:00 GMT
Last edited by Buggy McBugFace (bugbot) - Saturday, 25 November 2023, 20:23 GMT
Task Type Feature Request
Category Packages: Core
Status Closed
Assigned To Christian Hesse (eworm)
Architecture All
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

This more of a suggestion,

afaik the lines[1] in systemd.install file that create /var/log/journal/remote/ are not needed,
since the systemd-journal-remote.service has LogsDirectory=journal/remote and will create the directory automatically when/if needed.

The only difference I can see is that, systemd will create the directory as:
drwxr-xr-x 2 systemd-journal-remote systemd-journal-remote 4096 Apr 18 22:48 /var/log/journal/remote/

and the install script as:
drwxr-sr-x+ 2 root systemd-journal-remote 4096 Aug 2 2019 /var/log/journal/remote

but I guess systemd knows better here?

[1]
https://github.com/archlinux/svntogit-packages/blob/packages/systemd/trunk/systemd.install#L39-L41
This task depends upon

Closed by  Buggy McBugFace (bugbot)
Saturday, 25 November 2023, 20:23 GMT
Reason for closing:  Moved
Additional comments about closing:  https://gitlab.archlinux.org/archlinux/p ackaging/packages/systemd/issues/15
Comment by Christian Hesse (eworm) - Wednesday, 27 April 2022, 21:17 GMT
Uh, good question... These lines were added by dreisner about 7 years ago...
Will have to dig into this.

https://github.com/archlinux/svntogit-packages/commit/a699a681f582dcd00121629f54d09a14239fc7eb
Comment by Joao Machado (jcpvdm) - Friday, 29 September 2023, 10:25 GMT
I would say that not even /var/log/journal creation should be enforced during installation. See "Storage=" option in journald.conf (https://www.freedesktop.org/software/systemd/man/journald.conf.html#)

In my case I have manually created a symlink to redirect to an external storage:
lrwxrwxrwx 1 root root 25 Sep 29 10:19 /var/log/journal -> /mnt/storage/log/journal/
The problem is everytime pacman installs systemd, this symlink is removed and a new directory is created. It would be nice that this behavior changes:
1. Prompt the user if want to create a /var/log/journal directory during installation, or 2. don't create /var/log/journal during installation (at least when a file or directory already exists with same name)
Comment by loqs (loqs) - Friday, 29 September 2023, 11:15 GMT
> The problem is everytime pacman installs systemd, this symlink is removed and a new directory is created. It would be nice that this behavior changes:
You can use a bind mount instead of a symlink.
Comment by Joao Machado (jcpvdm) - Saturday, 30 September 2023, 15:44 GMT
bind mount is not ideal because when external storage is detached, bind mount is unmounted and rootfs /var/log/journal becomes exposed for systemd-journald to write on. using symlink is better because it always forces systemd-journald to fallback to /run/log/journal.

Loading...