You are not logged in.

#1 2019-02-22 13:39:29

bergentroll
Member
Registered: 2016-08-23
Posts: 31

Systemd: overriding user's service? [Solved]

I am a vdirsyncer user. Package provides /usr/lib/systemd/user/vdirsyncer.service and /usr/lib/systemd/user/vdirsyncer.timer units (i.e. units are in userspace). Timer supposed to be enabled with $ systemctl --user enable vdirsyncer.timer. Timer calls respective service. Documentation of vdirsyncer offers to override timer options with $ systemctl --user edit vdirsyncer.timer, and it works. But I want to override service (ExecStart actually). I see ~/.config/systemd/user/vdirsyncer.service.d/override.conf after $ systemctl --user edit vdirsyncer.service, it contents

[Service]
ExecStart=/usr/bin/torify /usr/bin/vdirsyncer

But override does not work, it seems like

$ systemctl --user show vdirsyncer.service | grep ExecStart
ExecStart={ path=/usr/bin/vdirsyncer ; argv[]=/usr/bin/vdirsyncer sync ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
ExecStart={ path=/usr/bin/torify ; argv[]=/usr/bin/torify /usr/bin/vdirsync sync ; ignore_errors=no ; start_time=[n/a] ; stop_time=[n/a] ; pid=0 ; code=(null) ; status=0/0 }
$ systemctl --user status vdirsyncer.service
● vdirsyncer.service - Synchronize calendars and contacts
   Loaded: loaded (/usr/lib/systemd/user/vdirsyncer.service; static; vendor preset: enabled)
  Drop-In: /home/anton/.config/systemd/user/vdirsyncer.service.d
           └─override.conf
   Active: failed (Result: exit-code) since Fri 2019-02-22 18:21:04 +05; 6s ago
     Docs: https://vdirsyncer.readthedocs.org/
  Process: 7838 ExecStart=/usr/bin/vdirsyncer sync (code=exited, status=1/FAILURE)
 Main PID: 7838 (code=exited, status=1/FAILURE)

(failed because my server is a hidden service, thus it acceptable through tor only.)

When I just copied service to ~/.config/systemd/user/vdirsyncer-torified.service and edited it, it works as I supposed to.

Systemd package is latest for now v241.7-2.

Am I misunderstanding something?

Last edited by bergentroll (2019-02-22 14:34:08)

Offline

#2 2019-02-22 14:12:27

WorMzy
Administrator
From: Scotland
Registered: 2010-06-16
Posts: 13,653
Website

Re: Systemd: overriding user's service? [Solved]

Add an empty ExecStart declaration above your override, that tells systemd you don't want to run the default ExecStart, just the override.


Sakura:-
Mobo: MSI MAG X570S TORPEDO MAX // Processor: AMD Ryzen 9 5950X @4.9GHz // GFX: AMD Radeon RX 5700 XT // RAM: 32GB (4x 8GB) Corsair DDR4 (@ 3000MHz) // Storage: 1x 3TB HDD, 6x 1TB SSD, 2x 120GB SSD, 1x 275GB M2 SSD

Making lemonade from lemons since 2015.

Offline

#3 2019-02-22 14:33:43

bergentroll
Member
Registered: 2016-08-23
Posts: 31

Re: Systemd: overriding user's service? [Solved]

Great! It seems working, thank you, WorMzy. Not too obvious behavior I would like to say. But I should RTFM more. My fault.

Last edited by bergentroll (2019-02-22 14:36:34)

Offline

Board footer

Powered by FluxBB