On Thu, Oct 30, 2014 at 12:10:16PM +0100, Karel Zak wrote:
> On Tue, Oct 28, 2014 at 02:29:35AM +0100, Lennart Poettering wrote:
> > On Mon, 27.10.14 14:10, Chris Leech (cle...@redhat.com) wrote:
> > 
> > > So for any mounts to remote block devices (unlike remote file system
> > > protocols which are detected by the fs name), unless there is an fstab
> > > entry at the time fstab-generator is run they get treated like local fs
> > > mounts and connectivity to the storage target may be disrupted before
> > > unmounting (possibly resulting in file system errors).
> > > 
> > > I'm currently at a loss for how to handle this, other than to claim that
> > > if filesystems are going to be left mounted they should be added to
> > > fstab and a daemon-reload is required.
> > 
> > IIRC mount nowadays stores the full mount option string, including all
> > the "userspace-only" options in /run. We could either read those
> > directly from there in systemd, or we could make systemd make use of
> > libmount to get that information.
> _netdev is information about device rather than about filesystem.
> Would be possible to have this info ("this is iSCSI") in udev db? 

Yes, the _netdev option is ugly.  For iSCSI specifically, we'd have to
trace the block device back to the scsi_host, then match that up with an
iscsi_host from the transport class.  Or come up with some change to
make that process easier.  And it would need to work for dm/md device
over the actually scsi device.
> You know, all userpsace mount options suck, it's always fragile to
> maintain mount options in userspace (due to namespaces, ...)
> > Karel, what are the details there? Would it be OK if we read the files
> > in /run directly to augment whatever we got from /proc/self/mountinfo?
> I'd like to keep /run/mount/utab as private libmount file. It would be
> better to use mnt_table_parse_mtab() libmount function to get parsed
> mountinfo + userspace mount options.
> IMHO you can implement it as optional feature #ifdef HAVE_LIBMOUNT to
> optionally use mnt_table_parse_mtab() from libmount rather than directly
> parse /proc/self/mountinfo.

Thanks for the direction, I've worked up a patch that does this and
using libmount here was pretty easy.

Unfortunatly with systemd triggering off of the change event from
/proc/self/mountinfo, it ends up racing with the mount command to access
/run/mount/utab and the _netdev option I'm looking for isn't
consistantly picked up.  I'll see what else I can come up with.

- Chris
systemd-devel mailing list

Reply via email to