[Pkg-iscsi-maintainers] Bug#691732: open-iscsi: umountiscsi.sh tries to umount / and /var

Dennis Leeuw D.Leeuw at umcutrecht.nl
Wed Oct 31 13:34:51 UTC 2012


Sorry for the late reply, but I had to fix some other stuff first.

On 10/29/2012 07:06 PM, Ritesh Raj Sarraf wrote:
>>
>> 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 / ... (warning).
>> umount: /var: 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 /var ... (warning).
>>  failed!
>> invoke-rc.d: initscript umountiscsi.sh, action "stop" failed.
>> Couldn't unmount all iSCSI devices. Cannot stop iSCSI service ... 
>> failed!
>>
>
> I can't see a reason why / and /var got pulled in... Can you run the 
> same init script in debug mode?

At the moment I can not. I had to revert everything since production had 
to go on. But I think I can explain what happened.

In the <code>for BLOCK_FILE in $SESSION_DIR/target*/*\:*/block/*; do</code>
with no block devices present the /block/ is not available, which sets 
the BLOCK_FILE variable to (in my case) 
/sys/devices/platform/host24/session20/target*/*:*/block/*
The sed command strips everything, meaning that BOCK_DEV contains "*"
The DOS_PARTITIONS variable is then set by awk while looking for ^/dev/* 
in /proc/mounts. In my case that means the following lines match:
/dev/mapper/vg0-root / ext4 
rw,relatime,errors=remount-ro,barrier=1,data=ordered 0 0
/dev/mapper/vg0-var /var ext4 rw,relatime,barrier=1,data=ordered 0 0
And $2 thus contains / and /var

umount now tries to unmount / and /var

Adding the if-statement which should actually read:
<code>if [ "${BLOCK_FILE}" = '${SESSION_DIR}/target*/*:*/block/*' ]; 
then</code>
makes sure that if BLOCK_FILE is set to the expression, it means that 
some part of the path did not exist and is does not try to unmount what 
it has found.

I hope this explains it better.

With kind regards,

Dennis Leeuw

-- 
ICT Medewerker
Divisie Biomedische Genetica
UMC Utrecht
Heidelberglaan 100 STR2.126
3584 CX  Utrecht
The Netherlands
06 27744048
intern: 64048


------------------------------------------------------------------------------

De informatie opgenomen in dit bericht kan vertrouwelijk zijn en is
uitsluitend bestemd voor de geadresseerde. Indien u dit bericht onterecht
ontvangt, wordt u verzocht de inhoud niet te gebruiken en de afzender direct
te informeren door het bericht te retourneren. Het Universitair Medisch
Centrum Utrecht is een publiekrechtelijke rechtspersoon in de zin van de W.H.W.
(Wet Hoger Onderwijs en Wetenschappelijk Onderzoek) en staat geregistreerd bij
de Kamer van Koophandel voor Midden-Nederland onder nr. 30244197.

Denk s.v.p aan het milieu voor u deze e-mail afdrukt.

------------------------------------------------------------------------------

This message may contain confidential information and is intended exclusively
for the addressee. If you receive this message unintentionally, please do not
use the contents but notify the sender immediately by return e-mail. University
Medical Center Utrecht is a legal person by public law and is registered at
the Chamber of Commerce for Midden-Nederland under no. 30244197.

Please consider the environment before printing this e-mail.



More information about the Pkg-iscsi-maintainers mailing list