Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[opentmpfiles-setup] chattr three error messages #2

Open
LW-archlinux opened this issue Mar 12, 2017 · 4 comments

Comments

Projects
None yet
3 participants
@LW-archlinux
Copy link

commented Mar 12, 2017

*� Setting up tmpfiles.d entries ...
chattr: Operation not supported while setting flags on /var/log/journal
chattr: No such file or directory while trying to stat /var/log/journal/%m
chattr: Operation not supported while setting flags on /var/log/journal/remote
[ !! ]�
*� ERROR: opentmpfiles-setup failed to start

kernel 4.10.1 , systemd 232, openrc 0.24, opentmpfiles 0.1.3
rc.txt

@vaeth

This comment has been minimized.

Copy link
Contributor

commented Apr 30, 2017

The error is caused by the systemd config file
/var/lib/tmpfiles.d/journal-nocow.conf:

h /var/log/journal - - - - +C
h /var/log/journal/%m - - - - +C
h /var/log/journal/remote - - - - +C

Of course, the nocow attribute cannot be set on many filesystems where it makes not sense (like ext2), and systemd gracefully ignores the corresponding "error" (which is more an informal message).

It is really annoying that opentmpfiles-setup fails to start because of such an informal message, thus preventing all dependent services to start properly, too.

A workaround is to generate a 0-byte file /etc/tmpfiles.d/journal-nocow.conf (BTW: systemd recommends for such "deactivations" to symlink the file to /dev/null: This does not work with opentmpfiles, either...)

Anyway, it would be nicer if opentmpfiles could handle this automatically without requiring such hacks (which have to be remembered to be removed when the underlying file system changes.)

@LW-archlinux

This comment has been minimized.

Copy link
Author

commented May 2, 2017

The config file with the problem is /usr/lib/tmpfiles.d/journal-nocow.conf .
No need to use a 0-byte file. I've copied the original to /etc/tmpfiles.d/ , then commented out those 3 lines & added a comment why i did.
Vaeth, thank you for this workaround .

I do think tmpfiles.d design is the problem here by allowing settings -that only work under certain conditions- to fail silently.

@williamh

This comment has been minimized.

Copy link
Contributor

commented May 2, 2017

Does systemd-tmpfiles ignore errors that are generated by commands in tmpfiles.d files?

@vaeth

This comment has been minimized.

Copy link
Contributor

commented May 2, 2017

Does systemd-tmpfiles ignore errors that are generated by commands in tmpfiles.d files?

It depends from case to case. For 'h' and 'H' the function path_set_attribute() of src/tmpfiles/tmpfiles.c is called (in case of H recursively).

This function returns with an error only if the file does not exist or is of a bad type.
It does not return with an error if the chattr_fd function fails. However, the error message is logged (and indeed it can be found with journalctl here).

then commented out those 3 lines

You commented out the only 3 non-comment lines of that file. So effectively you generated a 0-byte file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.