The officially official Devuan Forum!

You are not logged in.

#1 Yesterday 11:10:13

deutschem
Member
Registered: 2023-08-13
Posts: 10  

iSCSI autostart

Hello,

i want to automatically lgoin to an iSCSI target on boot.

the manual way works without problems
(for example:

iscsiadm -m node -T iqn.2025-09.internal.testing.site1:11111 -l

)

So ISCSI may be correct configured (yes, the option(s) node.startup is automatic)

I recognized that the iscsd deamon is not started after boot.
If I look into the /etc/iscsi/iscsid.conf I see

iscsid.startup = /bin/systemctl start iscsid.socket iscsiuio.socket

is uncommented, but we have no systemd ??...

Then I see

iscsid.startup = /usr/bin/service start iscsid

but service is in /usr/sbin .... and should it not look like "...../service iscsid start" ?

I tried all changes but on boot.log I get:

iSCSI initiator daemon not started: not logging in to default targets ... failed!

and

startpar: service(s) returned failure: open-iscsi ... failed!

If I do a

service iscsid start

and

service open-iscsi start

the login works automatically and fine.

(tests on other systemd-distros worked)
any help ?

regards

Last edited by deutschem (Yesterday 11:26:27)

Offline

#2 Yesterday 12:43:18

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,482  

Re: iSCSI autostart

Yes, you need to edit /etc/iscsid.conf to add a comment hash (#) for the systemctl line and uncomment the service line, which as you say would need to be corrected to read:

iscsid.startup = /usr/sbin/service iscsid start

This is a set up to start iscsid "on demand".

Aiui, open-iscsi service is a client side target administration service that depends on the connection service iscsid being started either as part of the boot sequence or on demand.

When you install open-iscsi the service is not enabled, and you need to enable at least open-iscsi (with the conf corrected as above). If you use sysvinit, the proper command for that is:

# update-rc.d iscsid enable
# update-rc.d open-iscsi enable

where the first command is optional; if the conf is corrected then the connection daemon is started on demand.

Those commands make it available on the next boot. If you need it before that you'll need to start open-iscsi manually.

Online

#3 Yesterday 14:11:49

deutschem
Member
Registered: 2023-08-13
Posts: 10  

Re: iSCSI autostart

ok, this worked.
but now I get

iscsiadm: initiator reported error (8 - connection timed out)
ls -l /etc/rc?.d/*iscsid

shows:
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc0.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc1.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc6.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 16:05 /etc/rcS.d/K01iscsid -> ../init.d/iscsid

should it be in runlevel 5 ?

if yes:
should I do this in Devuan with update-rc or sysv-rc-conf ?

thank you

regards

Last edited by deutschem (Yesterday 14:19:17)

Offline

#4 Yesterday 15:59:03

Andre4freedom
Member
Registered: 2017-11-15
Posts: 213  

Re: iSCSI autostart

no, there should be no "killscripts" (/etc/rc5.d/K01iscsid -> ../init.d/iscsid) in runlevel 5, because the system cannot go "down" to that level, only up to it (/etc/rc5.d/S01iscsid -> ../init.d/iscsid for example) or down from it. > RunLevel S, 4, 3, 2, 1, 0, 6.
Going down in runlevels activates the kill-scripts (also links!) and going up the start-scripts (links) of the target runlevel.
Special exceptions exist as always.
That's how Unix Init-SysV worked and still works.
Runlevel 0 = shutdown
Runlevel 6 = reboot
1,2,3,4,5 are runlevels. Default runlevel is defined in /etc/inittab.
Hope this helps.

Offline

#5 Yesterday 16:43:38

deutschem
Member
Registered: 2023-08-13
Posts: 10  

Re: iSCSI autostart

ok, now it looks like:
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc0.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc1.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 18:24 /etc/rc3.d/S16iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 18:16 /etc/rc5.d/S16iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc6.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 16:05 /etc/rcS.d/K01iscsid -> ../init.d/iscsid

and no iscsid error entry in boot log.

but:

service iscsid status
iscsid is not running ... failed!

regards

Offline

#6 Yesterday 22:37:45

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,482  

Re: iSCSI autostart

Hmm I think you may need to enable iscid as well, as the /etc/rcS.d/K01iscsid may cause it to be stopped inadvertently on boot. By enabling it, it will be started on boot even with the "on demand" set up, but otherwise it might get killed by init. It should really have kill links only in 0 and 6; (looks like the debian developer is less read-in on sysvinit than could be expected).

Online

#7 Today 08:09:29

deutschem
Member
Registered: 2023-08-13
Posts: 10  

Re: iSCSI autostart

now it looks like:

lrwxrwxrwx 1 root root 20  2. Okt 09:36 /etc/rc3.d/S17open-iscsi -> ../init.d/open-iscsi
lrwxrwxrwx 1 root root 20  2. Okt 09:36 /etc/rc5.d/S17open-iscsi -> ../init.d/open-iscsi
lrwxrwxrwx 1 root root 20  2. Okt 09:57 /etc/rcS.d/S17open-iscsi -> ../init.d/open-iscsi

and

lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc0.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc1.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 18:24 /etc/rc3.d/S16iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 18:16 /etc/rc5.d/S16iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  1. Okt 10:57 /etc/rc6.d/K01iscsid -> ../init.d/iscsid
lrwxrwxrwx 1 root root 16  2. Okt 09:22 /etc/rcS.d/S16iscsid -> ../init.d/iscsid

now I get again:

iscsiadm: initiator reported error (8 - connection timed out)

To keep coming, are the symlinks all correct now to principally, if the configs are all correct too, autostart iscsi and autologin ?

thanks

regards

Offline

#8 Today 09:50:09

Andre4freedom
Member
Registered: 2017-11-15
Posts: 213  

Re: iSCSI autostart

In which runlevel are you actually?

type your

iscsiadm

command and immediately after :

sudo runlevel

And show us the output.
Is there possibly something wrong with your iSCSI configuration or it's set-up?

Another note: iSCSI is good if you have a physically separate TCP/IP network for iSCSI. That means separate switches and cables!
Mixing it up with a network-protocol network gives severe headaches when there is a lot of network traffic.
The low-level network-params are different for block-protocols and network-protocols.
Using NFS is anyway the better solution, since NFS is a network-protocol. Consider that, please.

Offline

#9 Today 11:02:19

ralph.ronnquist
Administrator
From: Battery Point, Tasmania, AUS
Registered: 2016-11-30
Posts: 1,482  

Re: iSCSI autostart

@deutschem: I have assumed that you have 1) an iscsi server correctly set up and running, and 2) set up the client with the required configuration regarding targets and identities. Are those assumptions correct? To me it looks like the client (initiator) cannot connect to a server.

I'd suggest you don't worry about the rc?.d/ links too much; they only come into play at boot and shutdown.

Online

#10 Today 12:28:16

deutschem
Member
Registered: 2023-08-13
Posts: 10  

Re: iSCSI autostart

ok, runlevel was the tip of the day.
I am on Devuan and like Debian-way I think I am on runlevel 2 not 5. Based on that realization the login at boot works now. (sorry for the noise)

Last thing: it tries 2 times login at boot (first time 120 sec wait (ok,I can change that with node.session.initial_login_retry_max) second time login works immediately)

boot log:
.
.
Thu Oct  2 14:04:53 2025: Setting up iSCSI targets:
Thu Oct  2 14:04:53 2025: Logging in to [iface: default, target: iqn.2025-09.internal.testing.site1:11111, portal: 10.66.200.8,3260]
Thu Oct  2 14:05:09 2025: iscsiadm: Could not login to [iface: default, target: iqn.2025-09.internal.testing.site1:11111, portal: 10.66.99.8,3260].
Thu Oct  2 14:05:09 2025: iscsiadm: initiator reported error (8 - connection timed out)
Thu Oct  2 14:05:09 2025: iscsiadm:
Thu Oct  2 14:05:09 2025: Could not log into all portals
Thu Oct  2 14:05:09 2025: .
.
.
.
after entering runlevel 2
Thu Oct  2 14:05:15 2025: Setting up iSCSI targets:
Thu Oct  2 14:05:15 2025: Logging in to [iface: default, target: iqn.2025-09.internal.testing.site1:11111, portal: 10.66.200.8,3260]
Thu Oct  2 14:05:21 2025: Login to [iface: default, target: iqn.2025-09.internal.testing.site1:11111, portal: 10.66.200.8,3260] successful.
Thu Oct  2 14:05:21 2025: .

what am I missing ?

thank you

regards

Offline

Board footer