Re: F13 : setup NM runlevel 3



On Thursday 28 of October 2010 00:52:26 sean darcy wrote:
> On 10/27/2010 04:06 AM, Jirka Klimes wrote:
> > On Sunday 24 of October 2010 23:18:05 sean darcy wrote:
> >> I want to run a script when an interface goes up on a remote server.
> >> Since post-up no longer works, I need to use a dispatcher.d script. And
> >> that means NM. Sigh.
> > 
> > First, you are not forced to use NM. You can switch it off and configure
> > the interfaces some other way if you prefer.
> > Nevertheless, dispatcher script are the right way to run post-up (up)
> > scripts within NM.
> > For more info about the dispatcher see:
> > man NetworkManager
> > http://markmail.org/message/kd2afd3roenm2xsq
> 
> With post-up no longer available under the network service, isn't NM the
> only way to run scripts on interface up?
> 
What distro do you use anyway?
I think the post-up scripts are still available. E.g. use /sbin/ifup-local file 
to run whatever you want in Fedora/RHEL. For Debian-based distros, there is 
"post-up" directive in /etc/network/interfaces.

http://serverfault.com/questions/9198/using-if-up-and-if-down-scripts-to-
disable-wireless-when-eth1-is-plugged-in
http://www.debian.org/doc/manuals/reference/ch05.en.html

However, you have to decide what to use. Using legacy 'network' service on 
Fedora, /sbin/ifup-local is run for post up actions. On the other hand, when 
using NetworkManager, the script is not executed and you should use NM 
dispatcher scripts.

> >> The server has 2 wired nic's.  I need to make sure both nic's come up on
> >> reboot. NM is configured for runlevel 3. The only way I can think to get
> > 
> >> NM bring up the nic's is to use nmcli in rc.local:
> > NetworkManager will bring the interfaces up automatically when the
> > connections are configured so ("Connect automatically" checkbox in
> > connection editor, ONBOOT=yes in ifcfg files for Fedora/RHEL,
> > autoconnect=true for keyfile plugin (which is default), ...).
> > If you have configured the connection that way, you don't need other
> > tools to bring the interface up.
> 
> I tried that. With onboot=yes, the interfaces do not come up in runlevel
> 3. Even on my laptop, neither wired nor wireless connections come up
> unless I start X. I think the problem is that NM doesn't bring up
> anything unless it has a "client". And the clients are all X clients,
> except nmcli.
> 
> Is that wrong?
>
How did you configured your connections?
NM uses user and system settings. More info at 
http://live.gnome.org/NetworkManager/SystemSettings.
For system connections (including those configured in ifcfg files) no client is 
necessary. NM will activate them if they are to be connected automatically 
(ONBOOT=yes).
Check that you enabled NetworkManager service in level 3.
(on Fedora: chkconfig --list NetworkManager)

> >> nmcli con up id  | uuid
> >> 
> >> But I can't figure out how or where are the id's (or uuid's) of the
> >> interfaces. I tried
> >> 
> >> nmcli con up iface eth0
> >> 
> >> No luck.
> >> 
> >> nmcli dev list  doesn't show id's.
> >> lspci doesn't show them.
> >> 
> >> So where do I find the id's. And, is this the way to really make sure NM
> >> brings up these interfaces?
> > 
> > nmcli tells NM daemon to activate a connection (the same way as nm-applet
> > does). The command to do so is:
> > nmcli con up id "My super connection"   or
> > nmcli con up uuid a14d3a57-3ba5-4a4d-b8b0-589d4e1d5557
> > 
> > To list your configured connections (with NAMEs (id) and UUIDs (uuid))
> > use: nmcli con list
> > 
> > Jirka
> 
> nmcli con list
> 
> ** (process:25290): WARNING **: get_all_cb: couldn't retrieve system
> settings properties: (2) The name
> org.freedesktop.NetworkManagerSystemSettings was not provided by any
> .service files.
> 
The error says that NetworkManager is not running. That's why nmcli can't 
obtain any connections.

> I think the problem is that this command lists "configured" connections.
> But I can't configure the connection without NAMEs (id) or UUIDs (uuid)!
> 
> But how do I find out the id's or uuid's? Where are they stored? Does
> udev have them someplace?
> 
id is user-friendly name of a connection and uuid is unique identification of 
the connection. NM manage them and store them along with other connection's 
data. These id and uuid have nothing in common with udev.
You will get them via 'nmcli con list' output, but you need to have 
NetworkManager running.
And, when NM reads configuration from ifcfg files and the file doesn't contain 
NAME or UUID, NM generates them automatically.

Jirka


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]