shutdown fails.. nfs

Bug #192080 reported by Jesper Krogh
4
Affects Status Importance Assigned to Milestone
open-iscsi (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Binary package hint: open-iscsi

Hi.

A server with iscsi may look like this:
ls /etc/rc0.d/K*
lrwxrwxrwx 1 0 0 17 Nov 23 09:02 K09apache2 -> ../init.d/apache2
lrwxrwxrwx 1 0 0 16 Nov 7 11:12 K19autofs -> ../init.d/autofs
lrwxrwxrwx 1 0 0 24 Nov 7 11:23 K19postgresql-8.1 -> ../init.d/postgresql-8.1
lrwxrwxrwx 1 0 0 24 Nov 23 10:36 K19postgresql-8.2 -> ../init.d/postgresql-8.2
lrwxrwxrwx 1 0 0 28 Nov 7 11:22 K20nagios-nrpe-server -> ../init.d/nagios-nrpe-server
lrwxrwxrwx 1 0 0 20 Jan 17 20:15 K20open-iscsi -> ../init.d/open-iscsi
lrwxrwxrwx 1 0 0 17 Nov 7 11:22 K20postfix -> ../init.d/postfix
lrwxrwxrwx 1 0 0 20 Nov 7 10:58 K25hwclock.sh -> ../init.d/hwclock.sh
lrwxrwxrwx 1 0 0 20 Nov 7 11:50 K50alsa-utils -> ../init.d/alsa-utils
lrwxrwxrwx 1 0 0 20 Nov 7 11:23 K79nfs-common -> ../init.d/nfs-common
lrwxrwxrwx 1 0 0 27 Dec 4 11:07 K80nfs-kernel-server -> ../init.d/nfs-kernel-server
lrwxrwxrwx 1 0 0 19 Nov 7 11:22 K91bacula-fd -> ../init.d/bacula-fd

Which is bad.. if you have nfs exported our iscsi-volume. Then shutdown will fail due to the try to get open-iscsi stopped before the users of the disk is stopped.

So nfs should be shut down much earlier in the process or open-iscsi much later. (i suggest the latter)

sorta like
mv K20open-iscsi S50open-iscsi

Related branches

Revision history for this message
Soren Hansen (soren) wrote :

a) I assume you mean K50open-iscsi rather than S50open-iscsi

b) How does this fix the problem? K50open-iscsi would still get called before the nfs scripts (which are at K79 and K80).

Changed in open-iscsi:
status: New → Incomplete
Revision history for this message
LinuxBladeGuy (spam-nashira) wrote : Re: shutdown fails..

This bug is actually much more substantial than just NFS servers as indicated above. Any service that depends on iSCSI will cause problems. For instance, if the machine above has its postfix mail queue on an iSCSI volume, postfix can't shut down since the storage has been ripped out from under it!

There are serious issues with the iscsi startup and shutdown scripts. Examples:

- There is no mechanism to unmount iscsi volumes before shutting down iscsi
- The default startup scripts try to start iscsi before networking

In fact, I would say iSCSI support on Ubuntu (and Debian for that matter) is purely "experimental" at this time. For iSCSi to be considered of any real use:

1. boot-time filesystem checks should work
2. iscsi volumes should be mounted before anything else tries to start
3. iscsi volumes should be cleanly unmounted _AFTER_ all other services have shut down

With a fresh Hardy installation I see:

- iSCSI does not start up automatically at boot time, even though it appears it should
- iSCSI gets shut down before just about everything else, crashing the system on shutdown
- No mechanism in place to check if volumes are in use before shutting down iSCSI

RedHat has had this working properly since Enterprise 3. SuSE has had this working properly since SuSE Enterprise 9. We are YEARS behind here!!

Revision history for this message
Soren Hansen (soren) wrote : Re: [Bug 192080] Re: shutdown fails..

On Fri, Mar 28, 2008 at 01:04:46AM -0000, LinuxBladeGuy wrote:
> There are serious issues with the iscsi startup and shutdown scripts.

Oh, dear.

> Examples:
> - There is no mechanism to unmount iscsi volumes before shutting down iscsi

> - The default startup scripts try to start iscsi before networking

Not true (unless you're using network manager for your network
configuration). Interfaces are brought up as udev discovers them, which
is before we attempt to start iscsi.

> In fact, I would say iSCSI support on Ubuntu (and Debian for that
> matter) is purely "experimental" at this time. For iSCSi to be
> considered of any real use:
>
> 1. boot-time filesystem checks should work

Don't they?

> 2. iscsi volumes should be mounted before anything else tries to start

What's wrong with mounting them at the same time everything else is
mounted?

> 3. iscsi volumes should be cleanly unmounted _AFTER_ all other services have shut down

Correct. I wonder if simply not stopping iscsi during shutdown is a
reasonable approach. The kernel should flush everything anyway, so it
ought to be safe. Could you try that?

> With a fresh Hardy installation I see:
>
> - iSCSI does not start up automatically at boot time, even though it appears it should

Can you open a bug with some info about this?

--
Soren Hansen |
Virtualisation specialist | Ubuntu Server Team
Canonical Ltd. | http://www.ubuntu.com/

Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :

I found the cause of iSCSI not starting at boot, it's caused by having /usr on a separate file system. I have opened a new bug here:

https://bugs.launchpad.net/ubuntu/+source/open-iscsi/+bug/208441

I'm rebuilding my test system with /usr on the same partition as / and will see what else I can troubleshoot...

I've had a lot of experience with iSCSI on other distros and am more than happy to help test things out... We've got a pretty decent iSCSI SAN here. On the plus side, the initial performance tests I ran were extremely good, and I'm running this in VMWare!!

Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :

Not stopping iSCSI on shutdown doesn't actually fix the problem... We need to make sure that the iSCSI volumes are unmounted and then iSCSI is shut down properly.

If you watch the shutdown process, you see that all remaining processes get terminated before filesystems are unmounted. Unfortunately iscsid is one of the processes that gets killed. Result is the system hangs on shutdown...

Note that Debian has all the same problems... ;) Ask me how I know...

Now that I've done some more hammering away on this I can confirm that networking does indeed come up properly before iSCSI is started, as udev discovers the devices. I can also confirm that boot time filesystem checks are working properly. And yes, mounting iscsi volumes at the same time as everything else is perfectly fine... :)

Revision history for this message
LinuxBladeGuy (spam-nashira) wrote :

One more tidbit to throw on here with regards to shutting down open-iscsi...

If open-iscsi is not shut down cleanly, it never flushes write caches to disk... So it absolutely must be shut down properly or we potentially loose data. I'm talking about caches between us and the physical storage - ie on the iSCSI target, or on the back end disk array itself. During shutdown open-iscsi ensures that all data is actually commited to disk.

Revision history for this message
Peter Matulis (petermatulis) wrote :

Workaround:

In /etc/rc0.d change the symlink

K25open-iscsi

to

S80open-iscsi

Then try a shutdown test.

If successful, do something similar for /etc/rc6.d.

Revision history for this message
Launchpad Janitor (janitor) wrote :
Download full text (5.4 KiB)

This bug was fixed in the package open-iscsi - 2.0.870.1-0ubuntu1

---------------
open-iscsi (2.0.870.1-0ubuntu1) jaunty; urgency=low

  * New upstream release:
   - Support 2.6.26/27 kernels (LP: #289470).
   - Fix iscsid shutdown (LP: #181188).
  * Merge from Debian. Remaining Ubuntu changes:
   - Note: Debian version isn't 870~rc3 but 869.2 which leads to a big
     .diff.gz file. Only files in debian/ have been considered for this merge
     since debian hasn't patched the source.
   - debian/control, debian/rules, debian/open-iscsi-udeb*:
     + Add open-iscsi-udeb.
   - debian/open-iscsi.dirs:
     + rename dirs to open-iscsi.dirs because of open-iscsi-udeb addition.
     + drop network/if-up.d/ directory since we're using symlinks instead.
     + utilities installed in /bin,/sbin rather than /usr/bin,/usr/sbin.
   - debian/open-iscsi.init:
     + utilities installed in /bin,/sbin rather than /usr/bin,/usr/sbin.
     + lsb log messages.
     + Don't generate initiatorname name (moved to postinst).
     + Support for being called from ifup/ifdown scripts.
     + Refactor start functions:
       - move daemon start to startdaemon function.
       - call udevadm settle rather then udevsettle (which doesn't do anything
         useful).
       - don't exit if the daemon is already running during sanitychecks.
         Instead check in startdaemon if the daemon needs to be started.
       - only start automatic targets if necessary.
       - add waitfordevices function: called during rcS, waits for all
         automatic targets to be ready. Iscsi targets are considered as
         local block devices - they don't need to be marked with _netdev in
         fstab. (LP: #227848)
       - start targets if not run from rcS.
     + Check status of iscsid daemon in addition to listing the iscsi sessions
       when status action is called.
     + Add iscsid to the list of processes that should not be killed by
       sendsigs during shutdown (LP: #192080).
     + Add starttargets, stoptargets and restarttargets to usage message.
   - debian/rules:
     + Install utilities /bin,/sbin rather than /usr/bin,/usr/sbin.
     + Start open-iscsi at S25 (waiting for devices created by ifupdown
       calls and before local filesystems are checked and mounted)
     + stop at S41 (after local filesystems are unmounted). Don't use
       umountiscsi.sh script from debian. (LP: #192080).
   - debian/initiatorname.iscsi, debian/open-iscsi.postinst:
     + Generate the random initiatorname during postinstall rather than in the
     init script.
     + Don't ship a default initiatorname.iscsi file.
   - debian/open-iscsi.postinst:
     + fix init script ordering on upgrades.
   - debian/open-iscsi.links:
     + symlink open-iscsi init script in if-up.d and if-down.d directory so
       that the iscsi subsystem is started/stopped when network interfaces
       are configured.
   - debian/open-iscsi.postrm:
     + delete iscsi configuration when the package is purged.
   - utils/iscsi_discovery: De-bashify iscsi_discovery.
   - usr/idbm.c: Fix build failure with new glibc. LP: #299843.
  * Dropped:
   - Exit without error if /sys is not available. Otherwise, it's ...

Read more...

Changed in open-iscsi:
status: Incomplete → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.