From FedoraProject

< Tools | NetworkManager
Revision as of 12:24, 24 July 2012 by Pavlix (Talk | contribs)

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search

For debugging NetworkManager in a more or less clean environment, you can use the following script. It kills NetworkManager and dhclient instances, sets down eth0 and eth1, flushes global addresses and starts NetworkManager with debug saved into ~/nm.debug.

#!/bin/bash -x

KILL="NetworkManager dhclient"
LINKS="eth0 eth1"

for name in $KILL; do
	killall $name 2>/dev/null && echo "TERM: $name" && sleep 1
	killall -9 $name 2>/dev/null && echo "KILL: $name" && sleep 1

ps -ef | grep -iE 'network|dhc' | grep -v ' grep -iE '

for link in $LINKS; do
	ip link set $link down

ip address flush scope global

sleep 1

$NM --no-daemon --log-level=debug 2>$DEBUG