2015年6月27日星期六

Network Manager Configuration for BLFS 7.7

Update: 2015.12.13: fix some errors for icon theme

After we install the Network Manager (Networking Utilities), we have to modify the system configuration in order to allow the Network Manager fully control the network setting.

1. Remove the LFS network setup files
In the “7.5 General Network Configuration” section of LFS, we have created some “ifconfig.*” files for different network interfaces. Those files conflict with Network Manager so we have to remove them. Network Manager will create the configuration files in the “/etc/NetworkManager/system-connections” directory.

2. Install icons files for Network Manager Applet
Network Manager Applet (GNOME Applications) can be used with XFACE and LXDE. This software requires Adwaita Icon theme (GNOME Libraries and Utilities) to display all icons.

3. Update icons files for Network Manager Applet
run the following command:
gtk-update-icon-cache -qt /usr/share/icons/hicolor

4. Fix Polkit-gnome autostart problem for LXDE
If you use LXDE and the polkit daemon ("/usr/lib/polkit-1/polkitd --no-debug") is not started automatically, we have to modify the automatic startup file for polkit-gnome agent (/etc/xdg/autostart/polkit-gnome-authentication-agent-1.desktop):
The line "OnlyShowIn=GNOME;XFCE;Unity;" is changed to "OnlyShowIn=GNOME;XFCE;Unity;LXDE;"

5. Setup Polkit-gnome
In order to gain the permission for other users to setup and modify the network setting, we have to setup PolicyKit permission. Here are some references for the setup:
NetworkManager – ArchWiki
Polkit Reference Manual

For example, create a new group NNNNN and then add the users to this group:
usermod –a –G NNNNN user_xxxxx

And create a file in “/etc/polkit-1/rules.d/” directory that the content is:
polkit.addRule(function(action, subject) {
  if(action.id.indexOf(“org.freedesktop.NetworkManager”) == 0 && subject.IsInGroup(“NNNNN”)) {
    return polkit.Result.YES;
  }
});

Then the members of the group NNNNN will gain the permission to modify and setup the network setting by Network Manager Applet.

沒有留言: