From 843262fa5fab904534de676a95fad5a1b4f06dc1 Mon Sep 17 00:00:00 2001 From: Christoph Anton Mitterer Date: Tue, 4 Nov 2025 15:45:45 +0100 Subject: [PATCH 1/3] path-util: add generic `ignore` extension to the hidden/backup files MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit All currently ignored extensions either “belong” to some other program (and may thus be used, changed or interpreted by that) or imply a certain meaning (like `bak`, `old` and `new`). This adds the more generic extension `ignore` which is meant to imply no purpose whatsoever. A use case would be the following scenario: One might want to share a drop-in configuration over multiple units like in: `/etc/systemd/system/a.service/foo.conf` and `/etc/systemd/system/b.service/foo.conf`, which then would be symbolic links to the actual file. Of course one could place that actual file in a directory that is not parsed by systemd, but it is unit-configuration after all, so it would be nice to have it somewhere beneath `/etc/systemd/system` (or other parsed directories). However, placing it there needs a way to ensure that it’s never accidentally used by systemd, which this extension is meant for. --- src/basic/path-util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/basic/path-util.c b/src/basic/path-util.c index 0972dd8de0..7d11467a23 100644 --- a/src/basic/path-util.c +++ b/src/basic/path-util.c @@ -1304,6 +1304,7 @@ bool hidden_or_backup_file(const char *filename) { */ return STR_IN_SET(dot + 1, + "ignore", "rpmnew", "rpmsave", "rpmorig", From eee941bb6eb39bc806496cac159d3c8084460833 Mon Sep 17 00:00:00 2001 From: Christoph Anton Mitterer Date: Tue, 4 Nov 2025 17:10:11 +0100 Subject: [PATCH 2/3] test-path-util: add test for the generic `ignore` hidden/backup extension --- src/test/test-path-util.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/test-path-util.c b/src/test/test-path-util.c index cbe0341fe4..2251cd4fff 100644 --- a/src/test/test-path-util.c +++ b/src/test/test-path-util.c @@ -1202,6 +1202,7 @@ TEST(hidden_or_backup_file) { assert_se(hidden_or_backup_file("aquota.user")); assert_se(hidden_or_backup_file("aquota.group")); + assert_se(hidden_or_backup_file("test.ignore")); assert_se(hidden_or_backup_file("test.rpmnew")); assert_se(hidden_or_backup_file("test.dpkg-old")); assert_se(hidden_or_backup_file("test.dpkg-remove")); From 72a1cba5121c4b617ee82afe6bb0316a4de8716c Mon Sep 17 00:00:00 2001 From: Christoph Anton Mitterer Date: Tue, 4 Nov 2025 17:41:13 +0100 Subject: [PATCH 3/3] man: document some filename patterns that are generally ignored --- man/systemd.unit.xml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/man/systemd.unit.xml b/man/systemd.unit.xml index 7f552a687f..06085ca0ee 100644 --- a/man/systemd.unit.xml +++ b/man/systemd.unit.xml @@ -277,6 +277,10 @@ effective way to fully disable a unit, making it impossible to start it even manually. + Files (including directories) with names that match certain patterns are + generally ignored. This includes names that start with a . or + end with a .ignore. + The unit file format is covered by the Interface Portability and Stability Promise.