[systemd-devel] Path unit configuration starts early (DefaultDependencies=no)

Zbigniew Jędrzejewski-Szmek zbyszek at in.waw.pl
Mon Nov 11 09:23:45 PST 2013


On Mon, Nov 11, 2013 at 05:50:51PM +0100, Abdelghani Ouchabane wrote:
> On 11/11/13 17:35, Zbigniew Jędrzejewski-Szmek wrote:
> >On Mon, Nov 11, 2013 at 05:26:28PM +0100, Abdelghani Ouchabane wrote:
> >>Hallo,
> >>   I have two configuration files: ezono-cyclades-t_upn.path &
> >>ezono-cyclades-t_upn.service
> >>
> >>
> >>Where:
> >>
> >>ezono-cyclades-t_upn.path :
> >>
> >>[Unit]
> >>Description=ezono-cyclades-t_upn Service Spool
> >>DefaultDependencies=no
> >>Conflicts=shutdown.target
> >>Before=shutdown.target
> >>
> >>[Path]
> >>PathExists=/tmp/cyclades/start-ezono-cyclades-gui
> >>
> >>[Install]
> >>WantedBy=ezono-cyclades.target
> >>
> >>
> >>The problem is that by passing "DefaultDependencies=no"
> >>ezono-cyclades-t_upn.service doesn't start after
> >>/tmp/cyclades/start-ezono-cyclades-gui is created, even after all
> >>other units run and I delete /tmp/cyclades/start-ezono-cyclades-gui
> >>and create it again.
> >>
> >>Any idea please.
> >Is ezono-cyclaed.target enabled?
> Yes
> 
> ezono-cyclades.target - eZono Cyclades GUI
>    Loaded: loaded (/usr/lib/systemd/system/ezono-cyclades.target; enabled)
>    Active: active since Mon 2013-11-11 17:48:43 CET; 23s ago
> 
> Nov 11 17:48:43 sonostation-usb12-eth.ezono.net systemd[1]: Starting
> eZono Cyclades GUI.
> Nov 11 17:48:43 sonostation-usb12-eth.ezono.net systemd[1]: Reached
> target eZono Cyclades GUI.
The condition is only checked once, when the unit is started. I'd guess
that whatever creates /tmp/cyclades/start-ezono-cyclades-gui, does it
after the ezono-cyclades-t_upn.service/start job has already been done.
The condition will not be checked again unless you restart the servcie.

> >Also, DefaultDependencies=no is very unlikely to be what you need.
> I want to start ezono-cyclades-t_upn.path early as I can
That's not very convicing. I have no idea what it does, but
DefaultDependencies=no is only appropriate for services which
participate in bringing up the system.

Units that you show are very very complex, but it's unlikely that this
is all needed. E.g. don't implement your own strange logging
solutions, just start systemd with --log-level=debug and you'll get
full information about what is started and when. Also output from
services is logged to the journal by default.

> >Also, /tmp/cyclades is subject to "predicatable paths in /tmp" attack.
> >You should use a file in /run/.
> >
> >Zbyszek
> Thanks

Zbyszek


More information about the systemd-devel mailing list