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
  2. create extension files
  3. check your extension
| creating extension
mkdir /etc/systemd/system/httpd.service.d
| creating files to override specific variable
cat >/etc/systemd/system/httpd.service.d/limits.conf <<EOF
[Service]
LimitNOFILE=500000
EOF
-OR-
systemctl edit httpd
| check if your extension is recognized
systemd-delta --type=extended
systemd-delta --type=overridden