Bug 1262665 - /var/lib/systemd/journal-upload directory should have permission 0755
Summary: /var/lib/systemd/journal-upload directory should have permission 0755
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: systemd
Version: 24
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: ---
Assignee: systemd-maint
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2015-09-14 02:41 UTC by Yu Watanabe
Modified: 2017-01-12 01:29 UTC (History)
7 users (show)

Fixed In Version: systemd-232-2.fc26
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-01-12 01:29:09 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)
patch for systemd.spec (rawhide) (609 bytes, patch)
2015-09-14 02:47 UTC, Yu Watanabe
no flags Details | Diff

Description Yu Watanabe 2015-09-14 02:41:32 UTC
Description of problem:

/var/lib/systemd/journal-upload is created with wrong attribute 0644. It should be 0755. This cause systemd-journal-upload.service fail.

Version-Release number of selected component (if applicable):
systemd-journal-gateway-216-25.fc21.x86_64
systemd-journal-gateway-219-23.fc22.x86_64
systemd-journal-gateway-222-2.fc23.x86_64
systemd-journal-gateway-226-1.fc24.x86_64

How reproducible:

Steps to Reproduce:
1. Install systemd-journal-gateway
2.
3.

Actual results:

$ ls -l /var/lib/systemd | grep journal
drw-r--r-- 2 systemd-journal-upload systemd-journal-upload 4096 Sep  2 22:33 journal-upload

Expected results:
drwxr-xr-x 2 systemd-journal-upload systemd-journal-upload 4096 Sep  2 22:33 journal-upload

Additional info:

For rawhide,
http://pkgs.fedoraproject.org/cgit/systemd.git/tree/systemd.spec?id=41553e0ec20285504b5877172be59a736fde7811#n773
On line 773,
-----
%dir %attr(0644,systemd-journal-upload,systemd-journal-upload) %{_localstatedir}/lib/systemd/journal-upload
-----
should be
-----
%dir %attr(0755,systemd-journal-upload,systemd-journal-upload) %{_localstatedir}/lib/systemd/journal-upload
-----

Comment 1 Yu Watanabe 2015-09-14 02:47:19 UTC
Created attachment 1073046 [details]
patch for systemd.spec (rawhide)

I expect the patch can be also applied for f21-23.

Comment 2 Yu Watanabe 2016-10-13 05:57:43 UTC
This causes journal-remote crash when we update systemd-journal-remote.

Currently, updating process does the following.
1. systemd-journal-remote RPM package create /var/lib/systemd/journal-upload with 0644.
2. 'systemd-tmpfiles --create' command in the pre-script of systemd package maintains the permission from 0644 to 0755.

There exist a time lag between these steps. So, during the lag, journal-upload cannot save the state to /var/lib/systemd/journal-upload/state.

Below is the part of journal log during the updating process of systemd-*
====
dbus-daemon[355]: [system] Reloaded configuration
dbus-daemon[355]: [system] Reloaded configuration
dbus-daemon[355]: [system] Reloaded configuration
dbus-daemon[355]: [system] Reloaded configuration
systemd[1]: Reexecuting.
systemd[1]: systemd 231 running in system mode. (+PAM +AUDIT +SELINUX +IMA -APPARMOR +SMACK +SYSVINIT +UTMP +LIBCRYPTSETUP +GCRYPT +GNUTLS +ACL +XZ +LZ4 +SECCOMP +BLKID +ELFUTILS +KMOD +IDN)
systemd[1]: Detected architecture x86-64.
dbus-daemon[355]: [system] Reloaded configuration
dbus-daemon[355]: [system] Reloaded configuration
dbus-daemon[355]: [system] Reloaded configuration
dbus-daemon[355]: [system] Reloaded configuration
systemd[1]: Reloading.
systemd-journal-upload[560]: Failed to save state /var/lib/systemd/journal-upload/state: Permission denied
systemd[1]: systemd-journal-upload.service: Main process exited, code=exited, status=1/FAILURE
systemd[1]: systemd-journal-upload.service: Unit entered failed state.
systemd[1]: systemd-journal-upload.service: Failed with result 'exit-code'.
systemd[1]: Stopping udev Kernel Device Manager...
systemd[1]: Stopped udev Kernel Device Manager.
systemd[1]: Starting udev Kernel Device Manager...
systemd[1]: Started udev Kernel Device Manager.
systemd[1]: Reloading.
====

Comment 3 Yu Watanabe 2016-11-04 12:09:19 UTC
This bug is still not resolved in 232-1 for rawhide. Please fix it.


Note You need to log in before you can comment on or make changes to this bug.