Re: reboot hangs with "Reached target shutdown", who can help me?

2019-12-12 Thread can zhu
@The Lee-Man  Thanks, In my environment, the default value of the
node.startup is automatic in config



The Lee-Man  于2019年12月13日周五 上午5:17写道:

> Okay, I checked CentOS 8, and the services seem very similar to what I'm
> familiar with.
>
> You do indeed need to make sure your nodes have startup set to automatic.
>
> Use something like:
>
> > zsh> sudo iscsiadm -m node --op update --name 'node.conn[0].startup'
> --value automatic
>
> to update all nodes to start and stop automatically, and update startup in
> /etc/iscsi/iscsid.conf to change the default.
>
> --
> 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 view this discussion on the web visit
> https://groups.google.com/d/msgid/open-iscsi/5bdc3a89-e685-453d-8908-5a5c0e2f7332%40googlegroups.com
> 
> .
>

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/CAGJK1K%3DU0UsEn9Sv0%3DtOFo2hgBeWEE4gDaRtsgEg3-08g829BA%40mail.gmail.com.


Re: [PATCH] Check whether socket is opened successfully in find_vlan_dev func

2019-12-12 Thread Zhiqiang Liu
Friendly ping...

On 2019/12/9 14:32, liuzhiqiang (I) wrote:
> In find_vlan_dev func, socket should be checked before used.
> 
> Signed-off-by: Zhiqiang Liu 
> ---
>  usr/iscsi_net_util.c | 4 
>  1 file changed, 4 insertions(+)
> 
> diff --git a/usr/iscsi_net_util.c b/usr/iscsi_net_util.c
> index b5a910f..c38456f 100644
> --- a/usr/iscsi_net_util.c
> +++ b/usr/iscsi_net_util.c
> @@ -192,6 +192,10 @@ static char *find_vlan_dev(char *netdev, int vlan_id) {
>   int sockfd, i, rc;
> 
>   sockfd = socket(AF_INET, SOCK_DGRAM, 0);
> + if (sockfd < 0) {
> + log_error("Could not open socket for ioctl.");
> + return NULL;
> + }
> 
>   strlcpy(if_hwaddr.ifr_name, netdev, IFNAMSIZ);
>   ioctl(sockfd, SIOCGIFHWADDR, _hwaddr);
> 

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/939f1d1b-024d-99e2-c0ec-c5deb3bc63b6%40huawei.com.


Re: reboot hangs with "Reached target shutdown", who can help me?

2019-12-12 Thread The Lee-Man
Okay, I checked CentOS 8, and the services seem very similar to what I'm 
familiar with.

You do indeed need to make sure your nodes have startup set to automatic.

Use something like:

> zsh> sudo iscsiadm -m node --op update --name 'node.conn[0].startup' 
--value automatic

to update all nodes to start and stop automatically, and update startup in 
/etc/iscsi/iscsid.conf to change the default.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/5bdc3a89-e685-453d-8908-5a5c0e2f7332%40googlegroups.com.


Re: reboot hangs with "Reached target shutdown", who can help me?

2019-12-12 Thread The Lee-Man
On Tuesday, December 10, 2019 at 6:25:00 AM UTC-8, can zhu wrote:
>
> os version:
>
> CentOS Linux release 7.4.1708 (Core)
>
> kernel version:  
>
> 3.10.0-693.el7.x86_64
>
>
> systemd version:
>
> *systemd*-219-42.el7.x86_64
>
>
> Mount iscsi devices on the node(iscsi client node) and reboot os, hangs:
> ...
>

Hello:

Such issue are common if the proper sequencing is not followed when 
shutting down iSCSI connections.

One has to (in order):


   - if iscsi devices are being used, stop using them. That generally means 
   unmounting any filesystems that use the devices.
   - logout of the iSCSI connection, i.e. end the iscsi session cleanly
   - stop the iscsi daemon
   - now the network can be shutdown

And this of course assumes your target(s) are on other systems that are not 
being shut down.

As mentioned by Ulrich, this sequencing is now handled by systemd on most 
Linux systems. And the way in which this is handled is that these different 
layers are handled by different services. For example, on SUSE, the daemon 
is controlled by iscsid.socket and iscsid.service, and the login/logout is 
handled by iscsi.service.

I do not have a CentOS 7 system, but I'm downloading CentOS 8 to see how RH 
has set up the iSCSI services there.

But, at a low level, you must have the "startup" value set to "automatic" 
for targets to be disconnected automatically at shutdown time. So you 
should be able to run:

> zsh> sudo iscsiadm -m node --op show | fgrep startup

to see the startup value.

-- 
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 view this discussion on the web visit 
https://groups.google.com/d/msgid/open-iscsi/1cf29039-73ae-46df-8e0e-76c8f17fed15%40googlegroups.com.