On Friday, January 30, 2015 at 2:09:54 PM UTC-8, The Lee-Man wrote:
>
> Hi Mike:
>
> Just a heads up that stopping the open-iscsi iscsid daemon using systemd 
> doesn't seem to be working correctly, at least not on SUSE SLE 12.
>
> When I have one or more sessions present, and their startup value is set 
> to "manual", when I try to stop the iscsid service, I get:
>
>     # systemctl stop iscsid.service
>     Job for iscsid.service canceled.
>
> And a "ps" shows that iscsid is still running, but under a new process id. 
> And, at times, I see that "iscsiadm -k 0 2" is hung.
>
> Note that my systemd iscsid.service unit file looks like:
>
>     [Unit]
>     Description=Open-iSCSI
>     Documentation=man:iscsid(8) man:iscsiuio(8) man:iscsiadm(8)
>     DefaultDependencies=no
>     After=network.target iscsiuio.service
>     Before=remote-fs-pre.target
>
>     [Service]
>     Type=simple
>     ExecStart=/sbin/iscsid -f
>     ExecStop=/sbin/iscsiadm -k 0 2
>
>     [Install]
>     WantedBy=multi-user.target
>     Also=iscsid.socket
>
> While trying to track down this problem, I found a couple of issues:
>
> 1. I don't know what the "2" is on the "iscsiadm -k 0 2" is for. I see 
> that command in systemd unit file in your master branch, and I see that 
> other distributions use that, but the "2" seems to be ignored.
>
> 2. It looks like the "iscsiadm -k 0" is stopping the iscsi daemon, but 
> that systemd is restarting it! I'm guessing this because (a) I get the 
> "cancelled" message, and (b) iscsid is still running, but as a new process, 
> i.e. it's been restarted.
>
> I thought perhaps the problem was related to running iscsid as a "simple" 
> service, in the foreground, but changing Type to forking and removing the 
> "-f" from the iscsid command line did not change anything.
>
> Then I simply commented out the "ExecStop" line, and iscsid now shutdowns 
> correctly. This, I believe, is because systemd is shutting it down by 
> sending first SIGHUP then SIGKILL, as per "man systemd.kill".
>
> Before I comment out the "ExecStop=" for all SLE 12 users, I wondered if 
> you've heard of any problems along these lines.
>

I believe I found out more about the problem. It is because the iscsid 
service is socket-activated. There is an iscsid.socket service file, and 
that is used to wake up and start iscsid if iscsiadm tries to talk to 
iscsid and iscsid is not running.

I believe that what is happening is that:
1. iscsiadm tells iscsid to stop using a socket that systemd is monitoring
2. iscsid gets the message, cleans up, closes the socket, and exits
3. systemd restarts the service because the socket communication failed
4. systemd returns failure on the message (the "...cancelled" message) and 
restarts the iscsid service that just stopped

I looked for some systemd.socket(5) variable that would control this, but I 
see none.

I think the fundamental problem is that I am trying to stop a service via 
the socket that
was used to socket-activate the process. Kind of like trying to put away a 
ladder I am standing on. :)

-- 
You received this message because you are subscribed to the Google Groups 
"open-iscsi" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to open-iscsi+unsubscr...@googlegroups.com.
To post to this group, send email to open-iscsi@googlegroups.com.
Visit this group at http://groups.google.com/group/open-iscsi.
For more options, visit https://groups.google.com/d/optout.

Reply via email to