Bug 21819 - iscsi:fix the ConditionDirectoryNotEmpty parameter check path during the iscsi.service start
Summary: iscsi:fix the ConditionDirectoryNotEmpty parameter check path during the iscs...
Status: NEW
Alias: None
Product: Anolis OS 23
Classification: Anolis OS
Component: ---> ToBeTriaged (show other bugs) ---> ToBeTriaged
Version: 23.1
Hardware: All Linux
: P3-Medium S3-normal
Target Milestone: ---
Assignee: happy_orange
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-06-18 17:44 UTC by zhaoqiang11
Modified: 2025-06-18 18:25 UTC (History)
5 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description zhaoqiang11 2025-06-18 17:44:41 UTC
Description of problem:
In the higher version of iscsi-initiator-utils-2.1.8, the storage node information path has changed from /var/lib/iscsi/nodes/ directory to /etc/iscsi/nodes/ directory. After merging the 0001-unit-file-tweaks.patch patch, the iscsi service startup will check the ConditionDirectoryNotEmpty parameter, however, in the higher version of iscsi-initiator-utils-2.1.8, the ConditionDirectoryNotEmpty parameter value for /var/lib/iscsi/nodes/ path will cause the iscsi service to fail to start, making it impossible to automatically log into iscsi storage. 

Therefore, it is necessary to change the ConditionDirectoryNotEmpty parameter value in the iscsi service to /etc/iscsi/nodes/ path.


Version-Release number of selected component (if applicable):
iscsi-initiator-utils-2.1.8

How reproducible:
stable reproduction

Steps to Reproduce:
1.in the Anolis OS 23 version environment, the iSCSI storage node information generated by the command "iscsiadm -m discovery -t st -p 192.168.122.112" is stored in the /etc/iscsi/nodes path.
2.the automatic login is set by the command "iscsiadm -m node -o update -n node.startup -v automatic", and the iscsi service is enabled with the command "systemctl enable iscsi".
3.

Actual results:
The iSCSI service failed to start, and automatic login to the iSCSI storage also failed.

Expected results:
The iSCSI service started normally and can automatically log in to the iSCSI storage.

Additional info:

[root@localhost:~]$ systemctl status iscsi
○ iscsi.service - Login and scanning of iSCSI devices
     Loaded: loaded (/usr/lib/systemd/system/iscsi.service; enabled; preset: disabled)
     Active: inactive (dead)
  Condition: start condition unmet at Mon 2025-06-16 19:13:55 CST; 16h ago
       Docs: man:iscsiadm(8)
             man:iscsid(8)

Jun 16 19:13:55 localhost systemd[1]: iscsi.service - Login and scanning of iSCSI devices was skipped because of an unmet condition check (ConditionDirectoryNotEmp> 
[root@localhost:~]$ 
[root@localhost:~]$ journalctl -u iscsi -f
Jun 16 19:13:55 localhost systemd[1]: iscsi.service - Login and scanning of iSCSI devices was skipped because of an unmet condition check (ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes).


^C
[root@localhost:~]$ cat /usr/lib/systemd/system/iscsi.service
[Unit]
Description=Login and scanning of iSCSI devices
Documentation=man:iscsiadm(8) man:iscsid(8)
DefaultDependencies=no
Before=remote-fs-pre.target
After=network.target network-online.target iscsid.service iscsiuio.service systemd-remount-fs.service
Wants=remote-fs-pre.target
ConditionDirectoryNotEmpty=/var/lib/iscsi/nodes

[Service]
Type=oneshot
ExecStart=-/usr/sbin/iscsiadm -m node --loginall=automatic
ExecReload=-/usr/sbin/iscsiadm -m node --loginall=automatic
SuccessExitStatus=21
RemainAfterExit=true

[Install]
WantedBy=remote-fs.target
[root@localhost:~]$ ls /var/lib/iscsi/nodes
[root@localhost:~]$ ls /etc/iscsi/nodes/
iqn.2099-01.cn.com.zte:usp.spr30-84:13:9f:3e:12:fa  
iqn.2099-01.cn.com.zte:usp.spr30-84:13:9f:3e:13:0f
[root@localhost:~]$