В Wed, 19 Mar 2014 20:15:59 +0100 Per Jessen <per@computer.org> пишет:
Andrey Borzenkov wrote:
В Wed, 19 Mar 2014 11:50:57 +0100 Per Jessen <per@computer.org> пишет:
Related to my question "How do I make systemd wait for iscsi to start before attempting to mount iscsi-based filesystems?", I've been looking at the systemd startup order. What exactly does "systemctl --order" show - the status quo or what will happen on the next start-up?
I'm asking because I've added
Requires=remote-fs.target
to
/usr/lib/systemd/system/apache2.service
After a "systemctl --daemon-reload", the start-up sequence did not change as expected.
Requires is orthogonal to startup order. foo.service Requires bar.service means systemd will attempt to start bar.service when requested to start foo.service. It does *not* mean foo.service will be started after bar.service.
Use After/Before to influence relative startup order. Requires is almost always wrong (it is too strong dependency).
So if I want to indicate: "service A depends service B, do not start A unless B has been started" what should I use?
If you really mean what you ask, then A.service should have Requisite=B.service But again - this does not mean that if you call "systemctl start A.servcie B.service", B.service will be started first. To make sure, you need both Requisite=B.service After=B.service This ensures, that a) if startup of both A and B is requested, first B is started and then A b) if startup of A is requested but B is not started, startup of A fails.
I could be way wrong, but I'm not sure systemd considers iscsi filesystems to be remote? According to "systemctl --order" it will attempt to mount them before iscsi is started :-o
Well, how should systemd know it is iSCSI in the first place? When /etc/fstab is processed, nothing is yet started and device does not exist so it is not even possible to probe it.
That's why you were advised to use _netdev to inform systemd about it.
Yes, I've tried the _netdev option, but it doesn't change anything. systemd keeps trying to mount the filesystem before iscsi has logged into to the target and acquired it. This is the crux of the issue.
1. How did it work with sysvinit? In which order scripts were started during startup? What script did mount filesystems on iSCSI targets? 2. Did you try adding X-Systemd-Before as I suggested? -- To unsubscribe, e-mail: opensuse+unsubscribe@opensuse.org To contact the owner, e-mail: opensuse+owner@opensuse.org