3 ms·
It should have been split into something like systemd-tmpfiles and systemd-systemfiles. You can keep the same syntax and daemon binary, just keep the configurat
by Asooka 2y ago
It should have been split into something like systemd-tmpfiles and systemd-systemfiles. You can keep the same syntax and daemon binary, just keep the configuration of actually temporary and volatile files that can go away at any time separate from the configuration of system files. Running systemd-tmpfiles --cat-config on Arch with SystemD 255 shows some other fun things, like:
... snip ...
# /usr/lib/tmpfiles.d/arch.conf
# copy from factory when missing
C /etc/crypttab
C /etc/fstab
C /etc/group
C /etc/gshadow
C /etc/host.conf
C /etc/hosts
C /etc/issue
C /etc/ld.so.conf
C /etc/nsswitch.conf
C /etc/passwd
C /etc/profile
C /etc/securetty
C /etc/shadow
C /etc/shells
C /etc/subuid
C /etc/subgid
... snip ...
# /usr/lib/tmpfiles.d/home.conf
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
# See tmpfiles.d(5) for details
Q /home 0755 - - -
q /srv 0755 - - -
... snip ...
# /usr/lib/tmpfiles.d/openssh.conf
C /etc/pam.d/sshd
C /etc/ssh/moduli
C /etc/ssh/ssh_config
C /etc/ssh/sshd_config
C /etc/ssh/sshd_config.d/99-archlinux.conf
So if I ran --purge on this system I could kiss goodbye to all of /etc/fstab,groups,shadow,passwd; all of /home and /srv; and my entire sshd config. In fact, looking at the list of things managed by systemd-tmpfiles, at most 10% are actual temporary files and the rest are very important system files. In a way it is impressive how much feature creep has set in.
The stated purpose for --purge: to clean up a package's files, also doesn't seem sensible. That's the job of the package manager. If there are some files in the package's folders that weren't part of the original install, then they're obviously modified by the user and should not be touched by default. That's why package managers usually have an option for "remove package" and a separate option or flag for "and literally every file in every directory that belonged to it, including configuration I have modified".