udisks unmount and detach return exit status zero upon failure
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
udisks (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
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/
2. Ensure that the partition /dev/sdb1 is in use. To do so, simply open another terminal and move into it:
$ cd /media/
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://
100 /var/lib/
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.
Any updates on this?