broken
In-reply-to: Your message of "Sun, 17 Dec 2017 08:20:37 -0500."
             <20171217082037.2148ddd8@zooty>


On Sun, 17 Dec 2017 08:20:37 -0500 Tom Horsley wrote:

> On Sun, 17 Dec 2017 11:07:52 +0000
> Dr J Austin wrote:

>> Anyone else with the same problem/

> I gave up on getting NFS mounts to work a long time ago.

I had the same problem when (finally) deciding to reconfigure a server
to use NetworkManager instead of the old network service.

I manage to make it work with a "drop-in" configuration file for
NetworkManager-wait-online.service that replaces the call of nm-online
by waiting for all the wanted routes to be up and that a gateway is
reachable. See attachment.

For this server it's really long, and waiting for the routes is not
sufficient at all:

    Dec 17 12:46:37 xxx bash[1047]: Network Manager Wait Online routes 
took 9 seconds
    Dec 17 12:47:07 xxx bash[1047]: Network Manager Wait Online gateway 
took 30 seconds
    Dec 17 12:47:07 xxx systemd[1]: Started Network Manager Wait Online.

Francis

# Modifies NetworkManager-wait-online.service to replaces the call of
# nm-online by waiting for all the wanted routes to be up and that a
# gateway is reachable.

# Uses ip and fping.

# To install for example as:
#
#  /etc/systemd/system/NetworkManager-wait-online.service.d/routes-gw.conf
#
# Then adjust the ROUTES GW MAXWAIT variables below.

[Service]
ExecStart=
ExecStart=/bin/bash -c "LF=$'\n'; "' \
ROUTES=" \
  default \
  1.2.3.0/24 \
  4.5.6.0/24 \
"; \
GW=1.2.3.254; \
 \
MAXWAIT=60; \
 \
routes_defined () { \
    local routes=$(ip route); \
    echo "$routes"; \
    for i in $ROUTES; do \
        [[ "$LF$routes" == *$LF$i* ]] || return 1; \
    done; \
    return 0; \
}; \
 \
while (( SECONDS <= MAXWAIT)); do \
    if routes_defined; then \
        echo Network Manager Wait Online routes took $SECONDS seconds; \
        seconds=$SECONDS; \
        if fping -q -a -r $MAXWAIT -t 1000 -B 1 $GW >& /dev/null; then \
            s=$((SECONDS-seconds)); \
            echo Network Manager Wait Online gateway took $s seconds; \
            exit 0; \
        else \
            s=$((SECONDS-seconds)); \
            echo Network Manager Wait Online gateway failed after $s seconds; \
            exit 1; \
        fi; \
    fi; \
    sleep 1; \
done; \
echo Network Manager Wait Online routes failed after $SECONDS seconds; \
exit 1; \
 \
'
_______________________________________________
users mailing list -- users@lists.fedoraproject.org
To unsubscribe send an email to users-le...@lists.fedoraproject.org

Reply via email to