From 48ac1cebdedb055d9daf3dfe28c7bde80103f7a1 Mon Sep 17 00:00:00 2001 From: Colin Walters Date: Sep 11 2018 07:23:16 +0000 Subject: spec: Test for /var being writable before making /var/log/journal rpm-ostree has `/var` be read-only during package installs, because a whole part of the "transactional update" model is that your system's data stays untouched, and `/var` is system data. See e.g. https://src.fedoraproject.org/rpms/mock/pull-request/2 and the tracker https://bugzilla.redhat.com/show_bug.cgi?id=1352154 Just to squash some error spew during tree composes. --- diff --git a/systemd.spec b/systemd.spec index 51f844c..c338ad0 100644 --- a/systemd.spec +++ b/systemd.spec @@ -482,9 +482,10 @@ systemctl daemon-reexec &>/dev/null || : journalctl --update-catalog &>/dev/null || : systemd-tmpfiles --create &>/dev/null || : -if [ $1 -eq 1 ] ; then - # create /var/log/journal only on initial installation - mkdir -p %{_localstatedir}/log/journal +# create /var/log/journal only on initial installation, +# and only if it's writable (it won't be in rpm-ostree). +if [ $1 -eq 1 ] && [ -w %{_localstatedir} ]; then + mkdir -p %{_localstatedir}/log/journal fi # Make sure new journal files will be owned by the "systemd-journal" group