The problems with this script are wider than that, and it is broken in
several aspects. It runs at startup after other mount events and may
clobber the mounts present then.

My case is as follows: I need a read-only bind mount. Since bind mounts
cannot be given options right away, I have a line in fstab that fixes a
basic (r/w) bind mount, and then I have an upstart script which remounts
that mount read-only. Now, after that script this little joker comes
along and does "mount -o remount,commit=0", which loses the ro flag
again.

There are several issues here:

1. The script is not careful to retain the other mount flags when it
does its thing. Note that it cannot just reissue the mount flags in
fstab - it has to check the currently active flags and ensure that
everything except this "commit" setting remains untouched.

2. The script messes with bind mounts. I'm not certain, but I suspect
the commit setting only is applicable for real file system mounts.

3. The script runs on startup even when it has no business to mess
around at all. In my case it's a desktop computer always connected to
A/C. I would expect to be able to set whatever mount options I please in
fstab, and not get them clobbered by something elsewhere for a case that
is not at all relevant. It should be more careful to do this kind of
thing only when switches between A/C and battery actually take place.

4. The script does not give the opportunity to tune the commit timeouts
on a per-mount basis.

The proper way to go about this functionality would be to split the
commit setting into "commit_on_ac" and "commit_on_battery", so that both
can be controlled from fstab or at the appropriate mount places, where
ever they may be. But that's of course an entirely different cup of tea
than this crude hack. Anyway, fixing items (1) and (3) above would go a
long way in isolating its actions to the exact points where they are
supposedly beneficiary.

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/815545

Title:
  pm-utils overrides custom "commit=100" fstab mount option with
  "commit=0"

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pm-utils/+bug/815545/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to