Lost w/ dependencies

Kevin P. Fleming kevin at km6g.us
Thu Feb 18 20:10:29 GMT 2021


It would be better to discuss this on the systemd-devel list instead
of this one, but:

You are under the same misunderstanding that many people are. Putting
'After=gpsd.service' into the unit file for efis.service does *not*
mean that efis.service won't be started until after gpsd has been
started and completed its initialization. It only means that systemd
will issue a *start* job to start gpsd.service before issuing a
*start* job to start efis.service.

If you need efis.service to not be started until after gpsd has
created the SHM segment, then you'll have to find some way to make the
efis.service unit file wait until the SHM segment exists. I don't
think systemd knows how to do that itself, so you may have to
implement it via some sort of scripting which you can put into
ExecStartPre in efis.service.

On Thu, Feb 18, 2021 at 2:56 PM Hans Kurscheidt <lve0200 at gmail.com> wrote:
>
> Dear All,
>
> this is my 1st post here, please be patient....
>
> I'm lost in uname -a
> Linux orangepizero 4.19.62-sunxi #5.92 SMP Wed Jul 31 22:07:23 CEST 2019 armv7l GNU/Linux
>
> regarding systemd dependencies.
>
> I need efis.service starting after gpsd.service
>
> I put every possible dependency into the UNIT file, but efis.service stats always before. gpsd.service establishs a socket and a dbus shared memory section and depending on a race condition efis.service fails to start, due to a segementation violation, because gpsd has not yet established the SHM.
>
> systemctl --full status efis.service
> ● efis.service
>    Loaded: loaded (/lib/systemd/system/efis.service; enabled; vendor preset: enabled)
>    Active: active (running) since Thu 2021-02-18 19:32:16 CET; 32min ago
>  Main PID: 789 (OrPi_EFIS.out)
>     Tasks: 5 (limit: 4915)
>    CGroup: /system.slice/efis.service
>            └─789 /usr/bin/OrPi_EFIS.out
>
> Feb 18 19:32:16 orangepizero systemd[1]: Started efis.service.
> root at orangepizero:/home/hk# systemctl --full status gpsd.service
> ● gpsd.service - GPS (Global Positioning System) Daemon
>    Loaded: loaded (/lib/systemd/system/gpsd.service; enabled; vendor preset: enabled)
>    Active: active (running) since Thu 2021-02-18 19:32:16 CET; 33min ago
>   Process: 810 ExecStart=/usr/local/sbin/gpsd $GPSD_OPTIONS $OPTIONS $DEVICES (code=exited, status=0/SUCCESS)
>  Main PID: 822 (gpsd)
>     Tasks: 2 (limit: 4915)
>    CGroup: /system.slice/gpsd.service
>            └─822 /usr/local/sbin/gpsd -n /dev/ttyUSB0
>
> and here's the UNIT file
>
> cat /lib/systemd/system/efis.service
> [UNIT]
> Description=EFIS systemd service
> DefaultDependencies=true
> [Service]
> Type=simple
> BindsTo=dbus.service
> BindsTo=gpsd.socket
> After=dbus.service gpsd.service
> ExecStart=/usr/bin/OrPi_EFIS.out
> [Install]
> WantedBy=multi-user.target
> Also=gpsd.service
>
> Can you help, before I go crazy??
>
> Thank-you!
>
> hk
>
>



More information about the Pkg-systemd-maintainers mailing list