Skip to content

systemd

Extending configuration

This has bitten me many times, specially if you are running services as different user or require to extend the file limits.
Everytime there is update it replaces the file and it create the issue of broken services.

Here is simple example of overriding the configuration. 1. create extension folder 1. create extension files 1. check your extension

File: creating extension

mkdir /etc/systemd/system/httpd.service.d

File: creating files to override specific variable

cat >/etc/systemd/system/httpd.service.d/limits.conf <<EOF
[Service]
LimitNOFILE=500000
EOF
-OR-
systemctl edit httpd

File: check if your extension is recognized

systemd-delta --type=extended
systemd-delta --type=overridden