mirror of
https://github.com/archr-linux/Arch-R.git
synced 2026-03-31 14:41:55 -07:00
The ancient approach of symlinking /var/log to /storage/log doesn't play nice with systemd as it doesn't setup proper dependencies and unmounting /storage during shutdown may fail because systemd doesn't know that it's needed for /var/log. Use a conditional bind mount instead so systemd can automatically create proper dependencies and unmount filesystems in the correct order. Also store the persistent logfiles on /storage in a .cache/log directory instead of log to avoid confusing users - users can access logfiles via /var/log. Note: we can't use tmpfiles.d to create the .cache/log directory on /storage because that would run after local-fs.target but we need the .log directory before that so it has to be done via a one-shot service. Signed-off-by: Matthias Reichl <hias@horus.com>
10 lines
209 B
Desktop File
10 lines
209 B
Desktop File
[Unit]
|
|
Description=Create Persistent Log Directory on /storage
|
|
DefaultDependencies=no
|
|
RequiresMountsFor=/storage
|
|
|
|
[Service]
|
|
Type=oneshot
|
|
RemainAfterExit=yes
|
|
ExecStart=/bin/mkdir -p /storage/.cache/log/journal
|