'systemctl edit' not implemented ?

  • 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 ?

    • Offizieller Beitrag

    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.

    omv 7.0.4-2 sandworm | 64 bit | 6.5 proxmox kernel

    plugins :: omvextrasorg 7.0 | kvm 7.0.10 | compose 7.1.2 | k8s 7.0-6 | cputemp 7.0 | mergerfs 7.0.3


    omv-extras.org plugins source code and issue tracker - github


    Please try ctrl-shift-R and read this before posting a question.

    Please put your OMV system details in your signature.
    Please don't PM for support... Too many PMs!

  • 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


    Code
    [Service]
    Restart=always
    RestartSec=5

    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!