/etc/auto.net must abort if computer is not connected to a network.

Bug #184475 reported by Hans Deragon
4
Affects Status Importance Assigned to Milestone
autofs (Ubuntu)
New
Wishlist
Unassigned

Bug Description

For some unknown reason, each time I boot my computer, /etc/auto.net
would receive a request to connect to a server.

This would occur even when I am not connected to any network. The
consequence of this is that until a timeout (lasting well over a minute)
elapsed, my desktop (Gnome) would simply not respond after login.

I never was able to find out where the server was configured. `fgrep -r
<server name> ~${MYUSERNAME}/.??* /etc/*` never returned anything.

Still, /etc/auto.net should not try to connect to any server if the
computer is not connected to any network. I thus submit here a solution
to correct this flaw.

The following lines should be added at the beginning of /etc/auto.net

----------------------------->
# Checking if a gateway is available.
GWDETECTED=0
for GATEWAY in `route | egrep -v "^(Kernel|Destination|link-local)" |
  awk -F " " "{ print \\\$2}" | sed "s%\*%-%g"`; do
  if [ "${GATEWAY}" != "-" ]; then
    GWDETECTED=1
  fi
done

if ! ((${GWDETECTED})); then
  # No gateway is available. The computer is thus not connected to
  # any network. There is nothing to do here and to avoid unnecessary
  # timeouts, we exit.
  exit 0
fi
<-----------------------------

It does not resolve the problem at the source, but it does prevent
bugs elsewhere to temporary lock the computer.

Other, more efficient solutions might exist to detect a connection to
a network. Feel free to suggest or even implement a better solution.

My apologies for not providing a true patch; I do not have the original
/etc/auto.net file to create the patch from.

Daniel T Chen (crimsun)
Changed in autofs:
importance: Undecided → Wishlist
Revision history for this message
Gaetan Nadon (memsize) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better.
This particular bug has already been reported and is a duplicate of bug 78263, so it is being marked as such.
Please look at the other bug report as it seems to be the cause of your problem.
Additionally, any further discussion regarding the bug should occur in the other report. Feel free to continue to report any other bugs you may find.

BugSquad

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

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