[Pkg-iscsi-maintainers] Bug#775778: Bug#776276: unblock: open-iscsi/2.0.873+git0.3b4b4500-4
Christian Seiler
christian at iwakd.de
Tue Jan 27 12:07:07 UTC 2015
Am 27.01.2015 um 06:19 schrieb Michael Biebl:
>> Of course, if you have a better idea of how to do this?
>
> Aside from shipping real native unit files, that's probably the least
> invasive change:
>
> - Drop $remote_fs from the open-isci LSB header and replace it with
> $local_fs. That looks wrong anyway.
As I said before: that breaks sysvinit systems with /usr on NFS.
There's even an old bug report on that:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=541390
I really like your idea of a drop-in. And I also like the idea how you
call umountiscsi.sh, I didn't think of that. Unfortunately, it doesn't
work if I want to remove the After=remote-fs.target, since you can't
reset After= (or any unit dependency for that matter) to an empty list
in drop-ins.
But I thought a bit more about it: let's make dependencies a little
better by ordering open-iscsi after mountnfs. That would keep /usr on
NFS working for sysvinit, but make systemd happy, since mountnfs is
masked there (dependency therefore ignored).
But systemd's sysv-generator treats mountnfs the same as $remote_fs. So
close, but no cigar.
However, there's also mountnfs-bootclean. That service is ordered after
mountnfs in sysvinit, is also masked for systemd and does not receive
special treatment in systemd's sysv-generator.
So basically, you'd have the following changes w.r.t. the current
package in testing:
open-iscsi init script: s/$remote_fs/$local_fs mountnfs-bootclean/:
# Required-Start: $network $local_fs mountnfs-bootclean
# Required-Stop: $network $local_fs mountnfs-bootclean sendsigs
/lib/systemd/system/open-iscsi.service.d/fix-systemd-deps.conf:
[Unit]
# Make sure we have the proper ordering w.r.t. remote-fs-pre.target.
# Not required for boot, but for shutdown.
Wants=remote-fs-pre.target
Before=remote-fs-pre.target
[Service]
# Replace stop actions, because calling umountiscsi.sh from
# within open-iscsi script won't work due to systemctl
# redirection (and umountiscsi.sh is never started)
# Note that we have to test for /etc/iscsi/iscsi.initramfs,
# since the init script also does this test. Use exec to
# make sure that umountiscsi.sh's PPID is 1, so we don't run
# into the redirect ourselves.
ExecStop=
ExecStop=/bin/sh -c "[ -f /etc/iscsi/iscsi.initramfs ] || exec
/etc/init.d/umountiscsi.sh stop"
ExecStop=/etc/init.d/open-iscsi stop
I've just tried this, under systemd it works (no timeout, proper
ordering), and update-rc.d still generates the correct ordering of
startup links for sysvinit in /etc/rcS.d, with open-iscsi being after
mountnfs.
Would you be OK with that? If so, I can prepare a patch and send it to
Ritesh for inclusion.
Christian
More information about the Pkg-iscsi-maintainers
mailing list