Add support for Finit specific tmpfiles.d/

The tmpfilesd() glob sorts files according to name, we could name our
.conf as 00finit.conf to prevent ordering issues with, e.g. dnsmasq,
but this is more elegant and allows for multi-level override.

NOTE: bootmisc depends on the pidfile plugins since the latter need
      to set up its iwatches of /run before bootmisc creates /run.
      Depending on if it's a system with /var/run or /run we need to
      drop /var/run before recreating it.

Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
Joachim Wiberg committed 2023-02-28 00:49:55 +01:00
1 parent 28a90a793d
commit 11da93b759
5 files changed
+30 -10

No files matched your search

+9 -1
View File
@@ -439,11 +439,18 @@ static void tmpfiles(char *line)
warn("Failed %s operation on path %s", type, path);
}
/*
* Only the three last tmpfiles.d/ directories are defined in
* tmpfiles.d(5) as system search paths. Finit adds two more
* before that to have Finit specific ones sorted first, and
* a configure prefix specific one after that for user needs.
*/
void tmpfilesd(void)
{
/* in priority order */
char *dir[] = {
TMPFILES_PATH "/*.conf", /* Finit specific, not in tmpfiles.d(5) */
FINIT_TMPFILES "/*.conf",
TMPFILES_PATH "/*.conf",
"/usr/lib/tmpfiles.d/*.conf",
"/run/tmpfiles.d/*.conf",
"/etc/tmpfiles.d/*.conf", /* local admin overrides */
@@ -477,6 +484,7 @@ void tmpfilesd(void)
if (!fp)
continue;
// info("Parsing %s ...", fn);
while (!feof(fp)) {
char *line;