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

Document how to apply local tmpfiles.d override #8684

Closed
kaihendry opened this issue Apr 8, 2018 · 4 comments
Closed

Document how to apply local tmpfiles.d override #8684

kaihendry opened this issue Apr 8, 2018 · 4 comments

Comments

@kaihendry
Copy link

Submission type

  • Request for enhancement (RFE)

systemd version the issue has been seen with

238.51-1

Used distribution

Archlinux

In case of bug report: Expected behaviour you didn't see

Ability to restart tempfiles.d service in light of a local /etc/tmpfiles.d/smokeping.conf

In case of bug report: Unexpected behaviour you saw

[hendry@study ~]$ sudo systemctl restart systemd-tmpfiles-setup
Failed to restart systemd-tmpfiles-setup.service: Operation refused, unit systemd-tmpfiles-setup.service may be requested by dependency only (it is configured
to refuse manual start/stop).
See system logs and 'systemctl status systemd-tmpfiles-setup.service' for details.
@poettering
Copy link
Member

That's a safety precaution as specific tmpfiles rules are "destructive", they do stuff you really only want to do during early boot, and never later on. We mark those rules with ! in the tmpfiles snippets, and systemd-tmpfiles-setup.service passes --boot to the process which enables them, and then mark the service so that you cannot explicitly restart it as protection against accidentlly destroying your system during runtime.

Just invoke the binary on the command line with: systemd-tmpfiles --create --remove or so (and without --boot) to apply your modified tmpfiles snippets without all this

@poettering
Copy link
Member

Anyway, we could probably document the suggested command to apply changed configuration files in the documentation of those configuration files. We should probably not just do that for tmpfiles.d/ but for all our configuration files, actually, as it appears to be generally useful

@jrollins
Copy link

The documentation actually already describes how to do this, but it appears to not actually jive with the commands behavior. From systemd-tmpfiles(8):

If invoked with no arguments, it applies all directives from all configuration files. If one or more
absolute filenames are passed on the command line, only the directives in these files are applied.
If "-" is specified instead of a filename, directives are read from standard input. If only the
basename of a configuration file is specified, all configuration directories as specified in
tmpfiles.d(5) are searched for a matching file.

However, trying this produces an error:

root@h1guardian1:~# systemd-tmpfiles
You need to specify at least one of --clean, --create or --remove.
root@h1guardian1:~# systemd-tmpfiles /etc/tmpfiles.d/coredump.conf
You need to specify at least one of --clean, --create or --remove.
root@h1guardian1:~# systemd-tmpfiles - < /etc/tmpfiles.d/coredump.conf
You need to specify at least one of --clean, --create or --remove.
root@h1guardian1:~# 

So I agree that at least clarification in the documentation is in order, or change of behavior to correspond to the documentation.

@keszybz
Copy link
Member

keszybz commented Apr 25, 2018

On a related note, maybe we should add an option like -a/--all that'd be the same as --clean --create --remove, to make it easier to run from commandline?

keszybz added a commit to keszybz/systemd that referenced this issue Mar 1, 2021
We shouldn't imply that invocation without any parameters is OK.
Also, mention that the service can be restarted.

Fixes systemd#8684.
@keszybz keszybz closed this as completed in aa2e348 Mar 1, 2021
jkartseva pushed a commit to jkartseva/systemd that referenced this issue Mar 2, 2021
We shouldn't imply that invocation without any parameters is OK.
Also, mention that the service can be restarted.

Fixes systemd#8684.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

No branches or pull requests

4 participants