[Bug 1249856] Re: udisks unmount and detach return exit status zero upon failure
Launchpad Bug Tracker
1249856 at bugs.launchpad.net
Wed Apr 30 04:31:43 UTC 2014
Status changed to 'Confirmed' because the bug affects multiple users.
** Changed in: udisks (Ubuntu)
Status: New => Confirmed
--
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to udisks in Ubuntu.
https://bugs.launchpad.net/bugs/1249856
Title:
udisks unmount and detach return exit status zero upon failure
Status in “udisks” package in Ubuntu:
Confirmed
Bug description:
When the unmounting or detaching of an external USB flash drive (Pen
drive) fails, using the udisks command, an exit status of SUCCESS
(zero) is incorrectly returned.
Steps to reproduce:
1. Check that the external USB flash drive is mounted:
$ mount | grep ^/dev/sdb1
/dev/sdb1 on /media/mody/C207-484B type vfat (rw,nosuid,nodev,uid=1000,gid=1000,shortname=mixed,dmask=0077,utf8=1,showexec,flush,uhelper=udisks2)
2. Ensure that the partition /dev/sdb1 is in use. To do so, simply open another terminal and move into it:
$ cd /media/mody/C207-484B/
3. In a separate terminal attempt to unmount the partition that is in use:
$ udisks --unmount /dev/sdb1
Unmount failed: Cannot unmount because file system on device is busy
$ echo $?
0
Another test
$ udisks --unmount /dev/sdb1 && echo "successfully unmonted" || echo "Failed to unmount"
Unmount failed: Cannot unmount because file system on device is busy
successfully unmonted
4. Similarly run the test for udisks --detach like so:
$ udisks --detach /dev/sdb; echo $?
Detach failed: One or more partitions are busy on /dev/sdb
0
As you can see, clearly the udisks --unmount and the udisks --detach
commands fail, but the exit status returned is 0 or Success. This is
incorrect behavior. The echo $? should return a non-zero value.
Additional information:
1) The release of Ubuntu used:
Description: Ubuntu 13.04
Release: 13.04
2) The version of udisks in use:
udisks:
Installed: 1.0.4-7build1
Candidate: 1.0.4-7build1
Version table:
*** 1.0.4-7build1 0
500 http://us.archive.ubuntu.com/ubuntu/ raring/main amd64 Packages
100 /var/lib/dpkg/status
3) What you expected to happen:
When udisks --unmount and udisks --detach fail, the exit status should
return non-zero, indicating Failure.
4) What happened instead
When udisks --unmount and udisks --detach fail, the exit status
currently returs zero, indicating Success.
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/udisks/+bug/1249856/+subscriptions
More information about the foundations-bugs
mailing list