I need to modify a parameter of a service's unit file (/usr/lib/systemd/system/foo.service), but without modifying the unit file itself. According to numerous sources, systemd provides for this via what Arch Linux calls 'Drop-in files', which can override parameters of the unit file. When I tried to create a drop-in for a systemd service, via 'sudo systemctl edit foo.service', the result was "Unknown operation 'edit'." Not willing to give up, I used nano to create the drop-in file (in /etc/systemd/system/foo.d/override.conf), but when I tested the service, the override was ignored.
What am I doing wrong ?
'systemctl edit' not implemented ?
-
- OMV 3.x
- gelöst
- jaym
-
-
What am I doing wrong ?
depends on the systemd version. default jessie doesn't have it, backport one yes. But the drop in folder still works if you do it manually
-
systemd on omv 3.x is too old for the edit function. What you did is correct but you probably need to reload the systemctl daemon with systemctl daemon-reload. If that doesnt work, there must be an issue with the parameters in the override file.
-
-
Thanks, guys. You have encouraged me to give it another try.
I had done systemctl daemon-reload, and when that didn't help, I threw in a reboot also, but that didn't help either. The parameters I added were
If I add these same two items to the unit file, it works as expected: If I kill the service, it restarts a few seconds later. But in the override file, they have no effect. If I kill the service, it stays killed.
-
Found the problem:
/etc/systemd/system/foo-daemon.d/restart.conf
should be:
/etc/systemd/system/foo-daemon.service.d/restart.conf
With the directory named properly, the drop-in file works as expected.
Thanks again for the help.
Jetzt mitmachen!
Sie haben noch kein Benutzerkonto auf unserer Seite? Registrieren Sie sich kostenlos und nehmen Sie an unserer Community teil!