5

From ISCSI clients, we execute # systemctl start iscsi. However, i can see there is another service called iscsid.

Can anybody explain about iscsi service vs iscsid service in rhel7.?

2 Answers 2

3

iscsid is the daemon (system service) that runs in the background, acting on iSCSI configuration, and managing the connections. From its manpage:

The iscsid implements the control path of iSCSI protocol, plus some management facilities. For example, the daemon could be configured to automatically re-start discovery at startup, based on the contents of persistent iSCSI database.

The iscsi service that you can start with systemctl start iscsi is really just a shell script. It automatically starts iscsid, but then goes on to log into the targets you have marked for automatic login. Starting the iscsi service is what you want to do.

3
  • Are you really saying iscsi service only there to start iscsid.? Then, why on earth do we need iscsi service, we could just configure iscsid to automatically start by # systemctl enable iscsid Jul 16, 2015 at 1:39
  • No, not quite. While it does start iscsid, it also brings up the sessions that are marked for automatic start. You should be able to do systemctl enable iscsi to get it to start at boot. Jul 16, 2015 at 14:01
  • 1
    I do not believe this is strictly correct. The 'iscsid' service indeed manages the iscsid daemon. The 'iscsi' serivce is layered on top of the iscsid service, starting it if needed (again, as I understand it, since I don't have rhel running). The iscsi service does logins when starting and logouts when stopping to known targets, where the 'startup' value is set to 'automatic'.
    – Lee-Man
    May 18, 2016 at 16:14
-1

After doing some reading and some practices this is how i think iscsi differs from iscsid.

In a system that acting as iSCSI initiator, there are two particular iscsi services running. One is "iscsi service" and other is "iscsid service".

where, iscsid is the daemon that runs in the background while acting on iSCSI configuration and managing the connections.

On the otherhand, iscsi job is to execute its main config file - locate @ /etc/iscsi/iscsi.conf, which of course helps to brings the iscsi related sockets. As a part of that it also brings the iscsi targets those are set in /etc/iscsi/initiatorname.iscsi. However, this only gonna happen if it set "node.startup = automatic" in its main config file.

However, it also important to run the below commands once as that will create necessary files under /var/lib/iscsi/nodes/ - which holds iscsi specific target related information that is used by iscsid daemon to access the targets;
$ iscsiadm --mode discoverydb --type sendtargets --portal 192.168.5.81 --discover

$ iscsiadm --mode node --targetname iqn.2015-09.com.example:tgt1 --portal 192.168.5.81:3260 --login

1
  • 1
    You don't need to login to create target nodes; you only need --discover for that. --login maps the target node to a system block device, which is also handled by the iscsi service for targets which are set to start automatically.
    – pgoetz
    Oct 20, 2015 at 12:59

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .