"umountiscsi.sh" tries to unmount "/" root partition on "service open-iscsi stop" command if no block device assigned to iscsi device!
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
open-iscsi (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
Whilst trying to debug open-iscsi on Trusty (because it doesn't appear to be allocating a block-device to iSCSI assocaitions out of the box - a separate issue), it became apparent that I could not simply stop the open-iscsi device because when you do, but when no block device is associated with the iscsi session, it tries to un-mount "/" and obviously fails:
shared iscsi # /etc/init.
* Unmounting iscsi-backed filesystems umount: /: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
* Could not unmount /
invoke-rc.d: initscript umountiscsi.sh, action "stop" failed.
* Couldn't unmount all iSCSI devices. Cannot stop iSCSI service
The script responsible for this it "umountiscsi.sh", and installed as part of the open-iscsi package, and is run on stop by the init script to try and unmount any iscsi volumes before pulling down the iscsi daemon.
The section of code responsible is this:
for HOST_DIR in /sys/devices/
if ! [ -d $HOST_DIR/
fi
for SESSION_DIR in $HOST_DIR/session*; do
if ! [ -d $SESSION_
fi
for BLOCK_FILE in $SESSION_
done
done
I attach a very simple patch that fixes this - please include and push upstream.
The attachment "Patch to sanity check the block device returned is valid." seems to be a patch. If it isn't, please remove the "patch" flag from the attachment, remove the "patch" tag, and if you are a member of the ~ubuntu-reviewers, unsubscribe the team.
[This is an automated message performed by a Launchpad user owned by ~brian-murray, for any issues please contact him.]