Comment 2 for bug 1802354

Revision history for this message
Scott Moser (smoser) wrote :

The goal here should be simple.
 If there are iscsi sessions, then iscsid should be started/running.

You can tell if there are iscsi sessions by either:
 - 'iscsiadm --mode=session' exits 0
 - /sys/class/iscsi_session is non-empty.

The current open-iscsi.service implementation will not result in a
iscsid.service running if it did not create sessions (either because
they already existed or because there was nothing to do).

I'm trying to work out the best way to implement that logic in the
systemd services that we have now.

Would it be acceptable for the open-iscsi.service file to simply execute
 'systemctl start iscsid.service'
if there was content in /sys/class/iscsi_session ?

My testing shows that 'systemctl start SERVICE' for a service that
is already running exits 0 and is not harmful.