/proc/mounts shouldn't be required

Bug #337802 reported by Anders F Björklund
2
Affects Status Importance Assigned to Milestone
Smart Package Manager
Fix Released
Undecided
Unassigned

Bug Description

/proc/mounts shouldn't be required, as it is only available on Linux.

for now it would be OK to return isMounted=False instead of raising,
but eventually it should probably use the mount(8) output instead...

Related branches

Revision history for this message
Anders F Björklund (afb) wrote :
Revision history for this message
Gustavo Niemeyer (niemeyer) wrote :

As we discussed online, I'm a bit uncomfortable with simply returning False if it's not found. I'd like to see what the errors look like, and handle it appropriately. Blindly returning False on isMounted() and keeping everything else as is may present side-effects such as trying to mount an already mounted partition. If /proc/mounts isn't available on some operating systems where Smart is wanted, let's implement correct isMounted() support on them instead.

Revision history for this message
Anders F Björklund (afb) wrote :

This is a blocker on FreeBSD and Solaris, for some reason it works OK on Mac OS X...

The error looks like "Error: /proc/mounts not found" getting raised when looking for media.

Revision history for this message
Anders F Björklund (afb) wrote :

Example output (truncated) from mount(8) attached. Solaris seems to need special care.

tags: added: solaris
Revision history for this message
Anders F Björklund (afb) wrote :

I think this patch should do the trick, apparently there was a python library command for it...

tags: added: freebsd
Changed in smart:
milestone: none → 1.3
Revision history for this message
Anders F Björklund (afb) wrote :

Added, with tests, to trunk in r903.

Changed in smart:
status: New → Fix Committed
Changed in smart:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Bug attachments

Remote bug watches

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