[systemd-devel] [RFC] iscsid / systemd / dracut integration effort

The Lee-Man leeman.duncan at gmail.com
Mon Sep 23 10:33:36 PDT 2013


On Tuesday, December 11, 2012 3:26:46 PM UTC-8, Chris Leech wrote:
>
> ...
>
> Thanks, this got me going in the right direction.  These unit files 
> seems to be working much better for me, with the startup and shutdown 
> ordering between iscsi, iscsid, and remote-fs mounts sorted out.  I'm 
> not sure about the tgtd/targetcli stuff, not sure what the original need 
> there was. 
>
>
>
I just wanted to post a thank you for all of this work, as I was attempting 
to do some of it myself and making slow progress.

I am trying to get open-iscsi version 2.0-873-suse working on openSUSE.

In my case open-iscsi-based boot is not working and has not been working 
for a while. In addition, we have an initrd-based boot, and it looks like 
that will have to change before iscsid-based booting can work correctly. 
Because of that, I did not try to get iscsi-root volumes working. My goal 
was to get normal non-root open-iscsi working with systemd as well as it 
had with SysV-based init (or better).

Toward that end, I have 3 unit files that are working on openSUSE 12.3 that 
I thought I would share. I am not submitting these as patches, since the 
whole systemd-integration effort is still in flux.

Using the systemd configuration below, iscsid is not started until needed. 
NOTE: I think we need a new mode in iscsid that goes away when it's work is 
done, since it can now be socket-activated (i.e. it doesn't have to sit 
there and wait for work).


Submitted for your comments:


iscsid.socket:
==========
Unit]
Description=Open-iSCSI iscsid Socket
Documentation=man:iscsid(8) man:iscsiadm(8)

[Socket]
ListenStream=@ISCSIADM_ABSTRACT_NAMESPACE

[Install]
WantedBy=sockets.target



iscsid.service:
===========
[Unit]
Description=Open-iSCSI
Documentation=man:iscsid(8) man:iscsiadm(8)
After=network.target NetworkManager-wait-online.service tgtd.service 
targetcli.service

[Service]
Type=forking
PIDFile=/var/run/iscsid.pid
ExecStart=/sbin/iscsid

[Install]
WantedBy=multi-user.target



iscsi.service:
==========
[Unit]
Description=Login and scanning of iSCSI devices
Documentation=man:iscsiadm(8) man:iscsid(8)
After=network.target NetworkManager-wait-online.service iscsid.service
ConditionPathExists=/etc/iscsi/initiatorname.iscsi

[Service]
Type=oneshot
ExecStart=/sbin/iscsiadm -m node --loginall=automatic
ExecStop=/bin/sync
ExecStop=/sbin/iscsiadm -m session --logout
SuccessExitStatus=21
RemainAfterExit=true

[Install]
WantedBy=remote-fs.target
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/systemd-devel/attachments/20130923/b91594cf/attachment-0001.html>


More information about the systemd-devel mailing list