[systemd-devel] Problem with intermediate target
Dimitri John Ledkov
dimitri.j.ledkov at intel.com
Mon Apr 20 11:42:31 PDT 2015
On 18 April 2015 at 09:39, Christoph Pleger
<Christoph.Pleger at cs.tu-dortmund.de> wrote:
> Hello,
>
>>> Why does systemd start this service before /var is mounted, though the
>>> service should be executed after remote-fs.target, and remote-fs.target
>>> comes after local-fs.target?
>>>
>>
>> Because remote-fs.target is not part of initial transaction.
>>
>>> And why is this different in my intermediate.target than in
>>> multi-user.target, though intermediate.target defines exactly the same
>>> requirements, orders and conflicts as multi-user.target?
>>>
>>
>> Because systemd allows to declare extra dependencies that are not
>> directly part of unit definition. E.g. remote-fs.target has
>> WantedBy=multi-user.target. It is *not* dependencies listed in unit
>> configuration of multi-user.target that make it start remote-fs.target.
>>
>> When initial target is multi-user.target all those "reverse
>> dependencies" (for lack of better word) are pulled in and are part of
>> initial transaction. With another unit as initial target they are
>> skipped.
>
> Ah, I understand, that makes it clear. The auto-generated pident.service
> file only defines that the service should be executed after
> remote-fs.target, but it does not require it, and because no other service
> or target wants or requires remote-fs.target before pidentd.service
> starts, the filesystems are not yet mounted at that point.
>
> But then, I think that the way how systemd translates LSB init scripts
> should be changed. This is the LSB part of /etc/init.d/pidentd:
>
> ### BEGIN INIT INFO
> # Provides: pidentd-run-dir
> # Required-Start: $remote_fs
> # Required-Stop: $remote_fs
> # Default-Start: S
> # Default-Stop:
> # Short-Description: setup for pidentd
> # Description: create /var/run/ident for pidentd
> ### END INIT INFO
>
> As you can see, it defines remote-fs in Required-Start, not in
> Should-Start. In my opinion, this should result in an additional
> Requires=remote-fs.target in pidentd.service.
Early boot sysv scripts are also gone in Ubuntu. That is - they are
masked by native upstart jobs or systemd units.
For this case, why can't you specify RuntimeDirectory=ident to the
whichever unit pidentd is? Either directly in the unit, or as a
/lib/systemd/system/ident.service.d/rundir.conf or some such. And
ditch the sysv init script?
--
Regards,
Dimitri.
Pura Vida!
https://clearlinux.org
Open Source Technology Center
Intel Corporation (UK) Ltd. - Co. Reg. #1134945 - Pipers Way, Swindon SN3 1RJ.
More information about the systemd-devel
mailing list