[NetworkBrowser] Having disabled automounts can stop the automounter

Issue #717 resolved
prl created an issue

If there is more than one autofs Mount type in MENU>Setup>Network>Mount manager>Mountpoints management, disabling one of the mounts can stop the automounter completely (and the other automounts will not be mounted).

This is because when an autofs mount entry is processed by NetworkBrowser.AutoMount, it runs /etc/init.d/autofs stop; sleep 2 etc/init.d/autofs start if the mount entry is enabled, and /etc/init.d/autofs stop if it is disabled.

That means that if the last mount entry processed is disabled, the automounter will be stopped, even though there may be other active autofs mounts.

The code should run /etc/init.d/autofs reload instead, and run it only once if there are any autofs entries.

It should also use reload instead of start/stop when an autofs entry is removed.

Replication steps

Ensure that debug logging is running.

Create two "autofs" network share mounts in Menu>Setup>Network>Network browser as the only share mounts on the PVR.

Check that the mounts show in /media/autofs using ls in the command line.

Then in Menu>Setup>Network>Mount manager>Mountpoints management, select one of the mounts and change its "Active" entry to off, then OK to make the change. Note which mountpoint was disabled.

Then use grep 'command .*autofs st' current_logfile to check for the autofs commands run. The result will be either:

{17385}< 18567.829> command ['/etc/init.d/autofs stop', 'sleep 2', '/etc/init.d/autofs start']
{17385}< 18572.119> command ['/etc/init.d/autofs stop', 'sleep 2']

or

{17385}< 18724.580> command ['/etc/init.d/autofs stop', 'sleep 2']
{17385}< 18727.749> command ['/etc/init.d/autofs stop', 'sleep 2', '/etc/init.d/autofs start']

If the first case, the bug has been demonstrated and the automounter has been stopped. /media/autofs will be empty, even though one of the mounts should be there. If you examine the setup screen for both mounts, they will both show disabled, because the automounter is not running. That is why it's necessary to note which mount entry was disabled. Return to the setup screen for the mount disables and re-enable it. When that has been processed, both mounts should show.

If the second case, the bug has not been demonstrated. Return to the setup screen for the disabled and re-enable that mount entry, then disable the other one. The first case should now have been demonstrated.

Comments (1)

  1. Log in to comment