[Bug 1882986] Re: open-iscsi is slowing down the boot process
Rafael David Tinoco
1882986 at bugs.launchpad.net
Thu Aug 13 17:59:17 UTC 2020
Hello Zakhar,
I have the merge under review in
https://code.launchpad.net/~rafaeldtinoco/ubuntu/+source/open-iscsi/+git
/open-iscsi/+merge/389234
but I'm afraid it contains the same patches as we had for LP: #1755858:
commit ca21418
Author: Rafael David Tinoco <rafaeldtinoco at ubuntu.com>
Date: Wed Aug 12 21:19:36 2020
* make iscsid socket-activated to only activate it as needed
- debian/iscsid.socket: systemd socket file for iscsid
- debian/open-iscsi.service: do not start or check iscsid.service
- debian/rules: install and enable iscsid.socket
- debian/patches/iscid-conf-use-systemd.socket-patch: default to the socket
- debian/open-iscsi.postinst:
- run restart logic only if service is running on upgrade
- drop no longer reachable upgrade path that affects iscsid
- disable iscsid.service on upgrade
- handle iscsid.socket to be started if the service is not running yet
- d/iscsi-disk.rules: Add a udev rule so that iscsid.service will be
run when udev disks are attached.
- d/iscsid.service: Remove ExecStop= directive.
- debian/tests/install: fix tests to work with socket activation
Dropped:
* make iscsid socket-activated to only activate it as needed
- debian/patches/iscid-conf-use-systemd.socket-patch: default to the socket
- debian/open-iscsi.postinst:
- drop no longer reachable upgrade path that affects iscsid
- d/iscsi-disk.rules: Add a udev rule so that iscsid.service will be
run when udev disks are attached.
The dropped part is because Debian has that already now. The patches
that make "iscsid socket activated" are still the same. The idea is that
iscsid is only activated if needed. In my case, using iscsi disks, I
have:
(k)rafaeldtinoco at iscsiubu:~$ systemctl is-enabled open-iscsi.service
enabled
(k)rafaeldtinoco at iscsiubu:~$ systemctl is-enabled iscsid.service
disabled
(k)rafaeldtinoco at iscsiubu:~$ systemctl is-enabled iscsid.socket
enabled
so the open-iscsi.service will inevitably enable iscsid.service (through
its socket). If I do:
(k)rafaeldtinoco at iscsiubu:~$ systemctl disable --now open-iscsi.service
Synchronizing state of open-iscsi.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable open-iscsi
Removed /etc/systemd/system/iscsi.service.
Removed /etc/systemd/system/sysinit.target.wants/open-iscsi.service.
(k)rafaeldtinoco at iscsiubu:~$ systemctl disable --now iscsid.service
Synchronizing state of iscsid.service with SysV service script with /lib/systemd/systemd-sysv-install.
Executing: /lib/systemd/systemd-sysv-install disable iscsid
Warning: Stopping iscsid.service, but it can still be activated by:
iscsid.socket
and reboot...
(k)rafaeldtinoco at iscsiubu:~$ systemctl status iscsid.service
● iscsid.service - iSCSI initiator daemon (iscsid)
Loaded: loaded (/lib/systemd/system/iscsid.service; disabled; vendor preset: enabled)
Active: inactive (dead)
TriggeredBy: ● iscsid.socket
Docs: man:iscsid(8)
(k)rafaeldtinoco at iscsiubu:~$ systemctl status open-iscsi.service
● open-iscsi.service - Login to default iSCSI targets
Loaded: loaded (/etc/systemd/system/open-iscsi.service; disabled; vendor preset: enabled)
Active: inactive (dead)
Docs: man:iscsiadm(8)
man:iscsid(8)
and I have no iscsid daemon running:
(k)rafaeldtinoco at iscsiubu:~$ ps -ef | grep -i iscsi
root 469 1 0 17:50 ? 00:00:00 /sbin/iscsiuio
root 473 2 0 17:50 ? 00:00:00 [iscsi_eh]
root 474 2 0 17:50 ? 00:00:00 [iscsi_destroy]
rafaeld+ 969 549 0 17:51 hvc0 00:00:00 grep --color=never -i iscsi
(ignore iscsiuio, its part of packaging tests)
BUT, whenever I need to use iscsi volumes, I can use iscsiadm and iscsid
starts automatically:
(k)rafaeldtinoco at iscsiubu:~$ sudo iscsiadm -m node -P0
10.250.94.10:3260,1 iqn.2003-01.org.linux-iscsi.storage.x8664:sn.245b788cf3e3
(k)rafaeldtinoco at iscsiubu:~$ ps -ef | grep iscsid
<nothing>
(k)rafaeldtinoco at iscsiubu:~$ sudo iscsiadm -m node -l
Logging in to [iface: iscsi01, target: iqn.2003-01.org.linux-iscsi.storage.x8664:sn.245b788cf3e3, portal: 10.250.94.10,3260]
Login to [iface: iscsi01, target: iqn.2003-01.org.linux-iscsi.storage.x8664:sn.245b788cf3e3, portal: 10.250.94.10,3260] successful.
(k)rafaeldtinoco at iscsiubu:~$ ps -ef | grep iscsid
root 1015 1 0 17:52 ? 00:00:00 /sbin/iscsid
root 1016 1 0 17:52 ? 00:00:00 /sbin/iscsid
Meaning that the fixes for LP: #1755858 are indeed working.
---- Conclusion:
I really think there is nothing wrong with your setup, but the timing
among the systemd unit dependencies can, yes, vary depending on how many
units you have installed and the inter-dependencies they have (just like
you demonstrated in your experiments).
So.. the outcome here is: if you use open-iscsi you have:
open-iscsi.service disabled
iscsid.service disabled
iscsid.socket enabled
and you can activate your LUNs manually by doing: sudo iscsiadm -m node
-l
OR you can rely in the automatic iscsi login by having:
open-iscsi.service enabled
iscsid.service disabled
iscsid.socket enabled
If you are not using open-iscsi, simply uninstalling open-iscsi package
is better =). I'm closing this as "Opinion" because it is not an Invalid
argument, but it is also not a bug.
My take out is.. you will give 1.1.1-1ubuntu1 a try when its ready and,
if you think anything got worse, just let us know.
Thanks for all the discussion!
Best Regards
-rafaeldtinoco
** Merge proposal linked:
https://code.launchpad.net/~rafaeldtinoco/ubuntu/+source/open-iscsi/+git/open-iscsi/+merge/389234
** Changed in: open-iscsi (Ubuntu)
Status: Confirmed => Opinion
** Tags removed: server-next
** Changed in: open-iscsi (Ubuntu)
Assignee: Rafael David Tinoco (rafaeldtinoco) => (unassigned)
** Changed in: open-iscsi (Ubuntu)
Importance: Medium => Undecided
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to open-iscsi in Ubuntu.
https://bugs.launchpad.net/bugs/1882986
Title:
open-iscsi is slowing down the boot process
Status in open-iscsi package in Ubuntu:
Opinion
Bug description:
This is not a bug, but rather an "optimisation" request.
(Probably set this as "enhancement request" + Low)
Apparently, the package is assuming the user will need some iscsi
mounts for his session, and is putting dependencies in the systemd
services/targets which effects are to delay "graphical.target" to
after the point when the network is online.
A great job has been done by Ubuntu so that the O.S. appears to be
"snappy" from the boot, and when the session is in "auto-login", it
really makes a great difference and a good feeling of the system being
very quick.
This assumption of open-iscsi sort of ruins that effort.
As an example, on my PC the graphical target is delayed 10 seconds
more (was 22 seconds and is now 32). The impression is not as good and
the system feels "slow again" (although it is just a feeling!)
Step to reproduced (you don't even need to have iscsi LUNs to to so, just install the package!)
- Start from a clean 20.04, boot up and issue: systemd-analyze
- Now install open-iscsi, reboot and issue again: systemd-analyze
The result will probably be a big impact on "graphical target",
although total time does not change a lot.
My usage is not needing iscsi targets for my session.
I have a NAS with iscsi LUNs, and when I need those mounts, I just start them with a command.
sudo iscsiadm -m node -l
Then Gnome recognises a new disk has been inserted and does an "auto mount".
This command works whether the service was started or not.
This wrong assumption is easily fixed in my case with this command:
sudo systemctl disable iscsid.socket iscsid.service open-iscsi.service
Then, at the next reboot the graphical target is snappy again, and does not have to wait for network-online and remote-fs targets.
I don't know what can be done to cope with both situations : those who
need an iscsi target mounted for their session, and those who don't...
but I guess the philosophy now should be to assume the user does not
need such targets, and don't put dependencies that delay the snappy
boot process.
For those who need those mounted remote fs for their session, detailed
help on how to enable iscsi services at startup should be provided.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/1882986/+subscriptions
More information about the foundations-bugs
mailing list