Bug 2216793

Summary: systemd should create and own .conf.d directories
Product: Red Hat Enterprise Linux 8 Reporter: Orion Poplawski <orion>
Component: systemdAssignee: systemd maint <systemd-maint>
Status: NEW --- QA Contact: Frantisek Sumsal <fsumsal>
Severity: low Docs Contact:
Priority: unspecified    
Version: 8.8CC: dtardon, systemd-maint-list
Target Milestone: rc   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Orion Poplawski 2023-06-22 15:24:19 UTC
Description of problem:

man systemd-system.conf mentions:

/etc/systemd/system.conf.d and /usr/lib/systemd/system.conf.d
/etc/systemd/user.conf.d and /usr/lib/systemd/user.conf.d

systemd should create and own these directories.

Version-Release number of selected component (if applicable):
systemd-239-74.el8_8.x86_64

$ rpm -qf /etc/systemd/system.conf.d  /usr/lib/systemd/system.conf.d /etc/systemd/user.conf.d /usr/lib/systemd/user.conf.d
file /etc/systemd/system.conf.d is not owned by any package
error: file /usr/lib/systemd/system.conf.d: No such file or directory
error: file /etc/systemd/user.conf.d: No such file or directory
error: file /usr/lib/systemd/user.conf.d: No such file or directory

Comment 1 David Tardon 2023-06-26 07:54:21 UTC
(In reply to Orion Poplawski from comment #0)
> man systemd-system.conf mentions:
> 
> /etc/systemd/system.conf.d and /usr/lib/systemd/system.conf.d
> /etc/systemd/user.conf.d and /usr/lib/systemd/user.conf.d
> 
> systemd should create

No, it shouldn't. They are not needed until someone--either an admin or another package--needs to place a config. override there. Creating them unconditionally just adds needless clutter.

> and own these directories.

Yes, it probably should. But why limit it to just these config. dirs? Every systemd binary that does have a config. file (e.g., systemd-journald or systemd-coredump) reads respective config. dirs too.

Comment 2 Orion Poplawski 2023-07-16 03:20:27 UTC
I have found that the presence of various *.d directories in /etc is a very good indication that it is possible to use them.  Many packages create empty dirs as a guide to admins.  But I can see the opposite view as well.