systemd ignores drop-in configuration files - what am I doing wrong?
5
votes
1
answer
1870
views
On one of my machines with Debian Buster (which ships **systemd 241**), I wanted to watch resource usage via
systemd-cgtop
. When I started this utility, I was seeing memory usage, but neither CPU usage nor I/O usage. Obviously, CPU accounting was turned off.
Following the manpage for system.conf , I put the this line into /etc/systemd/system.conf
(all other lines already were commented out):
DefaultCPUAccounting=yes
This worked as expected (of course after having reloaded systemd
itself by systemctl daemon-reexec
). [ Note: In fact, I was still seeing CPU usage only for some slices, not for all, but this is another story / question. ]
However, that man page does not recommend to change /etc/systemd/system.conf
. Rather, we should create a drop-in configuration file with the required lines. I followed that advice, created the directory /etc/systemd/system.conf.d
, and created a file /etc/systemd/system.conf.d/10-pp.conf
. Then I removed the line shown above from /etc/systemd/system.conf
, put it into /etc/systemd/system.conf.d/10-pp.conf
, and issued systemctl daemon-reexec
.
This took me back to the beginning: systemd-cgtop
didn't show CPU usage at all.
I can reproduce the situation at any time. Regardless of the drop-in configuration file, I must alter the main configuration file to enable CPU accounting.
What am I doing wrong?
P.S.
- I have verified that there is no other drop-in configuration file which could hurt mine. That is, /usr/lib/systemd/system.conf.d/
does not exist, nor does /usr/local/lib/systemd/system.conf.d/
, nor does /run/systemd/system.conf.d/
.
- I have verified the access permissions of the directory and the file I have created. They are like the permissions of the other (installed-by-default) .d
directories and the files in them, respectively.
Asked by Binarus
(3901 rep)
Oct 15, 2021, 12:20 PM
Last activity: Oct 19, 2021, 12:01 PM
Last activity: Oct 19, 2021, 12:01 PM