↑ ↓ select, Enter open, Esc close

Change service settings with an override

Caution: This command changes the system. Understand what it does before you run it.

Adjust the values, the command updates live
root@server
systemctl edit mariadb

Creates /etc/systemd/system/<unit>.d/override.conf and opens it in the editor. Values entered there, for example [Service] with LimitNOFILE=65535 or Restart=on-failure, override the original file and survive package updates. After saving, systemd reloads the configuration automatically, but the service itself still needs to be restarted.

Note: List settings like ExecStart= must first be reset in the override with an empty ExecStart= line. The editor is determined by the SYSTEMD_EDITOR or EDITOR variable.

Also searched as

  • modify service file without losing it on update
  • create systemd override
  • increase limitnofile for a service
  • make service restart automatically

Related one-liners

All in systemd

Read first, then run.

The commands on myline.de act directly on servers, files and databases. A wrong path or placeholder can delete data irreversibly or make a server unreachable.

  • All commands are provided without warranty and are not tested on every system.
  • Understand what a command does before running it, and check every placeholder.
  • Make a backup first and, if possible, try it on a test system.
  • You run commands at your own risk. Liability for damages is excluded to the extent permitted by law.