https://wiki.archlinux.org/api.php?action=feedcontributions&user=Greenif&feedformat=atomArchWiki - User contributions [en]2024-03-29T05:25:54ZUser contributionsMediaWiki 1.41.0https://wiki.archlinux.org/index.php?title=Android_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=168852Android (Русский)2011-11-05T21:44:29Z<p>Greenif: /* Установка через Eclipse */</p>
<hr />
<div>В этой статье я постараюсь описать установку android-sdk под arch linux, включая особенности x64 систем.<br />
<br />
<br />
== Подготовка. ==<br />
<br />
Для работы нам понадобиться [[yaourt]]<br />
<br />
Также проследите, что бы в /etc/pacman.conf были сняты комментарии с следующих строк:<br />
<pre><br />
[multilib]<br />
Include = /etc/pacman.d/mirrorlist<br />
</pre><br />
<br />
Желательно обновить систему:<br />
<pre><br />
yaourt -Syu<br />
</pre><br />
ну или хотя бы синхронизировать репозитарии<br />
<pre><br />
yaourt -Sy<br />
</pre><br />
<br />
== Установка Oracle JDK ==<br />
Если у Вас все еще установлен openJDK удаляем его:<br />
<pre><br />
# pacman -Rdd openjdk<br />
</pre><br />
вторая "d" для того, что бы точно проигнорировать все зависимости от пакета.<br />
<br />
И устанавливаем стандартный JDK от Oracle.<br />
<pre><br />
# yaourt -S jdk<br />
</pre><br />
<br />
Проследите, что бы java была в PATH, ну или просто сделайте logout и login.<br />
<br />
== Установка Eclipse ==<br />
<pre><br />
#pacman -S eclipse<br />
</pre><br />
<br />
== Установка android-sdk ==<br />
Тут есть три пути:<br />
<br />
* установить через систему управления пакетами arch linux yaourt.<br />
* установить через Eclipse.<br />
* поставить в ручную.<br />
<br />
Последний вариант рассматривать не буду.<br />
<br />
{{Note|android-sdk существует только в варианте x86, в принципе это не проблема для x64, нужно только установить 32-х разрядные версии библиотек.<br />
Обратите на это внимание если выберите второй или третий вариант установки, иначе все установится, но работать не будет.}}<br />
<br />
=== Установка через yaourt. ===<br />
<pre><br />
# yaourt -S android-sdk<br />
</pre><br />
Преимуществом данного метода является то, что yaourt сам проследит и доставит все необходимые зависимости и про библиотеки можно не беспокоиться.<br />
<br />
Если ставили из под root, могут возникнуть трудности с доступом к папкам sdk, для устранения:<br />
<pre><br />
# chown -Rv <имя вашего пользователя> /opt/androi-sdk<br />
</pre><br />
<br />
{{Note|На данный момент установлены только базовые компоненты android-sdk, о чем сказано в /opt/android-sdk/SDK Readme.txt}}<br />
<br />
Для установки всех компонентов:<br />
<pre><br />
# cd /opt/android-sdk<br />
#./tools/android<br />
</pre><br />
<br />
<br />
=== Установка через Eclipse===<br />
Лично я предпочитаю этот метод.<br />
<br />
Устанавливаем все необходимые библиотеки:<br />
<pre><br />
# yaourt -S lib32-alsa-lib lib32-openal lib32-libstdc++5 lib32-libxv lib32-ncurses lib32-sdl lib32-zlib swt<br />
</pre><br />
Этот пункт не пройдет если вы не убрали комментарий с [multilib] в /etc/pacman.conf<br />
<br />
Запускаем Eclipse.<br />
<pre><br />
# eclipse<br />
</pre><br />
<br />
Далее идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: Indigo'''<br />
<br />
'''Location: http://download.eclipse.org/releases/indigo/'''<br />
<br />
Немного подождем, затем в последней категории:<br />
<br />
'''Web, XML, Java EE and OSGi Enterprise Development''' <br />
<br />
выбираем последний пункт<br />
<br />
'''WST Server Adapters'''<br />
<br />
Ну и устанавливаем выбранный компонент.<br />
<br />
Теперь опять идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: ADT plugin'''<br />
<br />
'''Location: https://dl-ssl.google.com/android/eclipse/'''<br />
<br />
'''Select All''' <br />
<br />
и заканчиваем установку.<br />
<br />
На панели Eclipse запускаем "Opens the Android SDK Manager"<br />
устанавливаем Tools и нужную нам версию платформы android.<br />
<br />
== Прописать PATH==<br />
В не зависимости от того каким путем Вы установили android-sdk, желательно прописать PATH в .bashrc или .bash_profile<br />
В моем случае это:<br />
<pre><br />
PATH=$PATH:/home/anton/android/android-sdk/tools:/home/anton/android/android-sdk/platform-tools<br />
</pre><br />
<br />
Вот и все, приятной работы!</div>Greenifhttps://wiki.archlinux.org/index.php?title=Android_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=168850Android (Русский)2011-11-05T21:41:25Z<p>Greenif: </p>
<hr />
<div>В этой статье я постараюсь описать установку android-sdk под arch linux, включая особенности x64 систем.<br />
<br />
<br />
== Подготовка. ==<br />
<br />
Для работы нам понадобиться [[yaourt]]<br />
<br />
Также проследите, что бы в /etc/pacman.conf были сняты комментарии с следующих строк:<br />
<pre><br />
[multilib]<br />
Include = /etc/pacman.d/mirrorlist<br />
</pre><br />
<br />
Желательно обновить систему:<br />
<pre><br />
yaourt -Syu<br />
</pre><br />
ну или хотя бы синхронизировать репозитарии<br />
<pre><br />
yaourt -Sy<br />
</pre><br />
<br />
== Установка Oracle JDK ==<br />
Если у Вас все еще установлен openJDK удаляем его:<br />
<pre><br />
# pacman -Rdd openjdk<br />
</pre><br />
вторая "d" для того, что бы точно проигнорировать все зависимости от пакета.<br />
<br />
И устанавливаем стандартный JDK от Oracle.<br />
<pre><br />
# yaourt -S jdk<br />
</pre><br />
<br />
Проследите, что бы java была в PATH, ну или просто сделайте logout и login.<br />
<br />
== Установка Eclipse ==<br />
<pre><br />
#pacman -S eclipse<br />
</pre><br />
<br />
== Установка android-sdk ==<br />
Тут есть три пути:<br />
<br />
* установить через систему управления пакетами arch linux yaourt.<br />
* установить через Eclipse.<br />
* поставить в ручную.<br />
<br />
Последний вариант рассматривать не буду.<br />
<br />
{{Note|android-sdk существует только в варианте x86, в принципе это не проблема для x64, нужно только установить 32-х разрядные версии библиотек.<br />
Обратите на это внимание если выберите второй или третий вариант установки, иначе все установится, но работать не будет.}}<br />
<br />
=== Установка через yaourt. ===<br />
<pre><br />
# yaourt -S android-sdk<br />
</pre><br />
Преимуществом данного метода является то, что yaourt сам проследит и доставит все необходимые зависимости и про библиотеки можно не беспокоиться.<br />
<br />
Если ставили из под root, могут возникнуть трудности с доступом к папкам sdk, для устранения:<br />
<pre><br />
# chown -Rv <имя вашего пользователя> /opt/androi-sdk<br />
</pre><br />
<br />
{{Note|На данный момент установлены только базовые компоненты android-sdk, о чем сказано в /opt/android-sdk/SDK Readme.txt}}<br />
<br />
Для установки всех компонентов:<br />
<pre><br />
# cd /opt/android-sdk<br />
#./tools/android<br />
</pre><br />
<br />
<br />
=== Установка через Eclipse===<br />
Лично я предпочитаю этот метод.<br />
<br />
Устанавливаем все необходимые библиотеки:<br />
<pre><br />
# yaourt -S lib32-alsa-lib lib32-openal lib32-libstdc++5 lib32-libxv lib32-ncurses lib32-sdl lib32-zlib<br />
</pre><br />
Этот пункт не пройдет если вы не убрали комментарий с [multilib] в /etc/pacman.conf<br />
<br />
Запускаем Eclipse.<br />
<pre><br />
# eclipse<br />
</pre><br />
<br />
Далее идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: Indigo'''<br />
<br />
'''Location: http://download.eclipse.org/releases/indigo/'''<br />
<br />
Немного подождем, затем в последней категории:<br />
<br />
'''Web, XML, Java EE and OSGi Enterprise Development''' <br />
<br />
выбираем последний пункт<br />
<br />
'''WST Server Adapters'''<br />
<br />
Ну и устанавливаем выбранный компонент.<br />
<br />
Теперь опять идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: ADT plugin'''<br />
<br />
'''Location: https://dl-ssl.google.com/android/eclipse/'''<br />
<br />
'''Select All''' <br />
<br />
и заканчиваем установку.<br />
<br />
На панели Eclipse запускаем "Opens the Android SDK Manager"<br />
устанавливаем Tools и нужную нам версию платформы android.<br />
<br />
<br />
== Прописать PATH==<br />
В не зависимости от того каким путем Вы установили android-sdk, желательно прописать PATH в .bashrc или .bash_profile<br />
В моем случае это:<br />
<pre><br />
PATH=$PATH:/home/anton/android/android-sdk/tools:/home/anton/android/android-sdk/platform-tools<br />
</pre><br />
<br />
Вот и все, приятной работы!</div>Greenifhttps://wiki.archlinux.org/index.php?title=Android_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=168848Android (Русский)2011-11-05T21:31:51Z<p>Greenif: /* Прописать PATH */</p>
<hr />
<div>В этой статье я постараюсь описать установку android-sdk под arch linux, включая особенности x64 систем.<br />
<br />
<br />
== Подготовка. ==<br />
<br />
Для работы нам понадобиться [[yaourt]]<br />
<br />
Также проследите, что бы в /etc/pacman.conf были сняты комментарии с следующих строк:<br />
<pre><br />
[multilib]<br />
Include = /etc/pacman.d/mirrorlist<br />
</pre><br />
<br />
Желательно обновить систему:<br />
<pre><br />
yaourt -Syu<br />
</pre><br />
ну или хотя бы синхронизировать репозитарии<br />
<pre><br />
yaourt -Sy<br />
</pre><br />
<br />
== Установка Oracle JDK ==<br />
Если у Вас все еще установлен openJDK удаляем его:<br />
<pre><br />
# pacman -Rdd openjdk<br />
</pre><br />
вторая "d" для того, что бы точно проигнорировать все зависимости от пакета.<br />
<br />
И устанавливаем стандартный JDK от Oracle.<br />
<pre><br />
# yaourt -S jdk<br />
</pre><br />
<br />
Проследите, что бы java была в PATH, ну или просто сделайте logout и login.<br />
<br />
== Установка Eclipse ==<br />
<pre><br />
#pacman -S eclipse<br />
</pre><br />
<br />
== Установка android-sdk ==<br />
Тут есть три пути:<br />
<br />
* установить через систему управления пакетами arch linux yaourt.<br />
* установить через Eclipse.<br />
* поставить в ручную.<br />
<br />
Последний вариант рассматривать не буду.<br />
<br />
{{Note|android-sdk существует только в варианте x86, в принципе это не проблема для x64, нужно только установить 32-х разрядные версии библиотек.<br />
Обратите на это внимание если выберите второй или третий вариант установки, иначе все установится, но работать не будет.}}<br />
<br />
=== Установка через yaourt. ===<br />
<pre><br />
# yaourt -S android-sdk<br />
</pre><br />
Преимуществом данного метода является то, что yaourt сам проследит и доставит все необходимые зависимости и про библиотеки можно не беспокоиться.<br />
<br />
Если ставили из под root, могут возникнуть трудности с доступом к папкам sdk, для устранения:<br />
<pre><br />
# chown -Rv <имя вашего пользователя> /opt/androi-sdk<br />
</pre><br />
<br />
=== Установка через Eclipse===<br />
Лично я предпочитаю этот метод.<br />
<br />
Устанавливаем все необходимые библиотеки:<br />
<pre><br />
# yaourt -S lib32-alsa-lib lib32-openal lib32-libstdc++5 lib32-libxv lib32-ncurses lib32-sdl lib32-zlib<br />
</pre><br />
Этот пункт не пройдет если вы не убрали комментарий с [multilib] в /etc/pacman.conf<br />
<br />
Запускаем Eclipse.<br />
<pre><br />
# eclipse<br />
</pre><br />
<br />
Далее идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: Indigo'''<br />
<br />
'''Location: http://download.eclipse.org/releases/indigo/'''<br />
<br />
Немного подождем, затем в последней категории:<br />
<br />
'''Web, XML, Java EE and OSGi Enterprise Development''' <br />
<br />
выбираем последний пункт<br />
<br />
'''WST Server Adapters'''<br />
<br />
Ну и устанавливаем выбранный компонент.<br />
<br />
Теперь опять идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: ADT plugin'''<br />
<br />
'''Location: https://dl-ssl.google.com/android/eclipse/'''<br />
<br />
'''Select All''' <br />
<br />
и заканчиваем установку.<br />
<br />
На панели Eclipse запускаем "Opens the Android SDK Manager"<br />
устанавливаем Tools и нужную нам версию платформы android.<br />
<br />
<br />
== Прописать PATH==<br />
В не зависимости от того каким путем Вы установили android-sdk, желательно прописать PATH в .bashrc или .bash_profile<br />
В моем случае это:<br />
<pre><br />
PATH=$PATH:/home/anton/android/android-sdk/tools:/home/anton/android/android-sdk/platform-tools<br />
</pre><br />
<br />
Вот и все, приятной работы!</div>Greenifhttps://wiki.archlinux.org/index.php?title=Android_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=168847Android (Русский)2011-11-05T21:27:57Z<p>Greenif: Created page with "В этой статье я постараюсь описать установку android-sdk под arch linux, включая особенности x64 систем. == П..."</p>
<hr />
<div>В этой статье я постараюсь описать установку android-sdk под arch linux, включая особенности x64 систем.<br />
<br />
<br />
== Подготовка. ==<br />
<br />
Для работы нам понадобиться [[yaourt]]<br />
<br />
Также проследите, что бы в /etc/pacman.conf были сняты комментарии с следующих строк:<br />
<pre><br />
[multilib]<br />
Include = /etc/pacman.d/mirrorlist<br />
</pre><br />
<br />
Желательно обновить систему:<br />
<pre><br />
yaourt -Syu<br />
</pre><br />
ну или хотя бы синхронизировать репозитарии<br />
<pre><br />
yaourt -Sy<br />
</pre><br />
<br />
== Установка Oracle JDK ==<br />
Если у Вас все еще установлен openJDK удаляем его:<br />
<pre><br />
# pacman -Rdd openjdk<br />
</pre><br />
вторая "d" для того, что бы точно проигнорировать все зависимости от пакета.<br />
<br />
И устанавливаем стандартный JDK от Oracle.<br />
<pre><br />
# yaourt -S jdk<br />
</pre><br />
<br />
Проследите, что бы java была в PATH, ну или просто сделайте logout и login.<br />
<br />
== Установка Eclipse ==<br />
<pre><br />
#pacman -S eclipse<br />
</pre><br />
<br />
== Установка android-sdk ==<br />
Тут есть три пути:<br />
<br />
* установить через систему управления пакетами arch linux yaourt.<br />
* установить через Eclipse.<br />
* поставить в ручную.<br />
<br />
Последний вариант рассматривать не буду.<br />
<br />
{{Note|android-sdk существует только в варианте x86, в принципе это не проблема для x64, нужно только установить 32-х разрядные версии библиотек.<br />
Обратите на это внимание если выберите второй или третий вариант установки, иначе все установится, но работать не будет.}}<br />
<br />
=== Установка через yaourt. ===<br />
<pre><br />
# yaourt -S android-sdk<br />
</pre><br />
Преимуществом данного метода является то, что yaourt сам проследит и доставит все необходимые зависимости и про библиотеки можно не беспокоиться.<br />
<br />
Если ставили из под root, могут возникнуть трудности с доступом к папкам sdk, для устранения:<br />
<pre><br />
# chown -Rv <имя вашего пользователя> /opt/androi-sdk<br />
</pre><br />
<br />
=== Установка через Eclipse===<br />
Лично я предпочитаю этот метод.<br />
<br />
Устанавливаем все необходимые библиотеки:<br />
<pre><br />
# yaourt -S lib32-alsa-lib lib32-openal lib32-libstdc++5 lib32-libxv lib32-ncurses lib32-sdl lib32-zlib<br />
</pre><br />
Этот пункт не пройдет если вы не убрали комментарий с [multilib] в /etc/pacman.conf<br />
<br />
Запускаем Eclipse.<br />
<pre><br />
# eclipse<br />
</pre><br />
<br />
Далее идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: Indigo'''<br />
<br />
'''Location: http://download.eclipse.org/releases/indigo/'''<br />
<br />
Немного подождем, затем в последней категории:<br />
<br />
'''Web, XML, Java EE and OSGi Enterprise Development''' <br />
<br />
выбираем последний пункт<br />
<br />
'''WST Server Adapters'''<br />
<br />
Ну и устанавливаем выбранный компонент.<br />
<br />
Теперь опять идем в<br />
<br />
'''Help => Install New Software => Add'''<br />
<br />
'''Name: ADT plugin'''<br />
<br />
'''Location: https://dl-ssl.google.com/android/eclipse/'''<br />
<br />
'''Select All''' <br />
<br />
и заканчиваем установку.<br />
<br />
На панели Eclipse запускаем "Opens the Android SDK Manager"<br />
устанавливаем Tools и нужную нам версию платформы android.<br />
<br />
<br />
== Прописать PATH==<br />
В не зависимости от того каким путем Вы устанавливали android-sdk желательно прописать PATH в .bashrc или .bash_profile<br />
В моем случае это:<br />
PATH=$PATH:/home/anton/android/android-sdk/tools:/home/anton/android/android-sdk/platform-tools<br />
<br />
Вот и все, приятной работы!</div>Greenifhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=126030NetworkManager2010-12-26T16:07:19Z<p>Greenif: /* Network Services with NetworkManager Dispatcher */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NetworkManager}}<br />
[[de:Networkmanager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Wireless Setup}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to be able to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by RedHat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager is available in the official repositories:<br />
<br />
# pacman -S networkmanager<br />
<br />
== Graphical Front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's applet (formerly gnome-network-manager) is lightweight enough and works across all environments:<br />
<br />
# pacman -S network-manager-applet<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users":<br />
<br />
# pacman -S gnome-keyring<br />
<br />
=== KDE4 ===<br />
<br />
The KNetworkManager front-end has been made available in KDE version 4.4 as a plasma widget:<br />
<br />
# pacman -S kdeplasma-applets-networkmanagement<br />
<br />
The GNOME counterpart works just as nicely, or even better (has more features and detects more hardware).<br />
<br />
{{Note|If you are changing from another network managing tool like Wicd, do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
=== KDE3 ===<br />
<br />
Though no longer supported, {{Package AUR|knetworkmanager}} is in the [[AUR]]. Package name:<br />
knetworkmanager<br />
<br />
=== Openbox ===<br />
<br />
The GNOME applet with the xfce4-notifyd notification daemon works well:<br />
<br />
# pacman -S network-manager-applet xfce4-notifyd hicolor-icon-theme gnome-icon-theme<br />
<br />
If you want to store authentication details (Wireless/DSL):<br />
<br />
# pacman -S gnome-keyring<br />
<br />
To prevent nm-applet dbus errors, edit ~/.xinitrc and change "exec openbox-session" to<br />
"exec ck-launch-session openbox-session".<br />
<br />
To have Openbox's autostart.sh start nm-applet properly, you may need to delete the file /etc/xdg/autostart/nm-applet.desktop (You may need to delete this file again after every update to network-manager-applet)<br />
<br />
Then in autostart.sh, start nm-applet with this line:<br />
<br />
(sleep 3 && /usr/bin/nm-applet --sm-disable) &<br />
<br />
=== Other Desktops and Window Managers ===<br />
<br />
It is recommended to use the GNOME applet. You'll also need to be sure that the GNOME hicolor theme is installed to be able to display the applet:<br />
<br />
# pacman -S hicolor-icon-theme gnome-icon-theme<br />
<br />
=== Command line ===<br />
<br />
cnetworkmanager, which is now available in the community repository, can be used to configure connections from the command line.<br />
<br />
# pacman -S cnetworkmanager<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{Filename|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{Filename|/etc/hosts}}:<br />
<br />
<pre><br />
#<ip-address> <hostname.domain.org> <hostname> <br />
127.0.0.1 localhost.localdomain localhost dell-latitude<br />
</pre><br />
<br />
=== Disable current network setup ===<br />
<br />
You'll want to disable your current network setup to be able to properly test NetworkManager. First (if using the Arch Linux network scripts) stop the network:<br />
<br />
/etc/rc.d/network stop<br />
<br />
Bring down your NIC's (Network Interface Controllers, i.e. network cards). For example:<br />
<br />
ifconfig eth0 down<br />
ifconfig wlan0 down<br />
<br />
Edit {{Filename|/etc/rc.conf}} and where you defined DHCP or a static IP address, comment them out:<br />
<br />
<pre><br />
#eth0="dhcp" <br />
#wlan0="dhcp" <br />
INTERFACES=(!eth0 !wlan0)<br />
</pre><br />
<br />
=== Edit daemons ===<br />
<br />
You must ''remove'' the default '''network''' daemon and add the '''networkmanager''' daemon, after the dbus daemon:<br />
<br />
DAEMONS=( ...'''dbus networkmanager'''... )<br />
<br />
Be sure that the package {{Package Official|dbus}} is installed as NetworkManager will require it. To start other services (daemons) that require a network connection see the next section on how to set them up. Though the NetworkManager daemon has been started here, it will not (by default) connect onto a network until an applet is loaded and the applet specifies to do so. This means that networking services will need to be specified to NetworkManager on when to run.<br />
<br />
=== Network Services with NetworkManager Dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are '''openntpd''' and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network (interface up), and stop them when you are no longer using them (interface down).<br />
<br />
To use this feature, scripts can be added to the {{Filename|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it's good practice to make them owned by '''root:root''' and writable only by the owner.<br />
{{Warning|For security reason. You should disable write access for group and other. For example use 755 mask.<br />
In other case it can refuse to execute script, with error message "nm-dispatcher.action: Script could not be executed: writable by group or other, or set-UID." in /var/log/messages.log }}<br />
<br />
The scripts will be run in alphabetical order at connection time (with arguments ''interface up''), and in reverse alphabetical order at disconnect time (''interface down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{Filename|10_portmap}} or {{Filename|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
The following starts openntpd when an interface is brought up. Save the file as {{Filename|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<pre><br />
#!/bin/sh<br />
<br />
INTERFACE=$1 # The interface which is brought up or down<br />
STATUS=$2 # The new state of the interface<br />
<br />
case "$STATUS" in<br />
'up') # $INTERFACE is up<br />
exec /etc/rc.d/openntpd start<br />
;;<br />
'down') # $INTERFACE is down<br />
# Check for active interface and down if no one active<br />
if [ ! `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
exec /etc/rc.d/openntpd stop<br />
fi<br />
;;<br />
esac<br />
</pre><br />
<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Use dispatcher to connect to a vpn after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a vpn-connection we defined previously with NetworkManager. First thing to to is to create the dispatcher-script that defines what to do after we connected to the network.<br />
<br />
1. Create the dispatcher script in {{Filename|/etc/NetworkManager/dispatcher.d/vpn-up}}<br />
<br />
case "$2" in<br />
up)<br />
sudo -u username DISPLAY=:0 /usr/bin/python /etc/NetworkManager/vpn-up.py<br />
;;<br />
esac<br />
<br />
Remember to make it executable with chmod +x and change '''username''' to the right one.<br />
<br />
2. Create the {{Filename|/etc/NetworkManager/vpn-up.py}} and change '''network-ESSID''' to the desired one. You'll find the code [http://dpaste.com/hold/203441/ here].<br />
<br />
Now NetworkManager should try to connect to your vpn which you had defined in your profile.<br />
<br />
=== Proxy settings ===<br />
<br />
Network Manager does not directly handle proxy settings.<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. First start the daemon:<br />
<br />
/etc/rc.d/networkmanager start<br />
<br />
Some applets will provide you with a .desktop file so that the NetworkManager applet can be loaded through the application menu. If it doesn't, you're going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant Window Managers like Awesome:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
==Troubleshooting==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Network Management Disabled ===<br />
<br />
Sometimes when NM shuts down the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'l have to remove it manually:<br />
<br />
rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{Filename|etc/rc.local}} to have it removed upon bootup:<br />
<br />
<pre>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</pre><br />
<br />
=== NetworkManager prevents DHCPCD from using resolv.conf.head and resolv.conf.tail ===<br />
<br />
Sometimes it's problematic to add static items to resolv.conf when it's constantly rewritten by nm and dhcpcd. You can use networkmanager-dhclient package from AUR but a better solution is to use this simple script:<br />
<br />
<pre><br />
#!/bin/bash<br />
# <br />
# /etc/NetworkManager/dispatcher.d/99-resolv.conf-head_and_tail<br />
# Include /etc/resolv.conf.head and /etc/resolv.conf.tail to /etc/resolv.conf<br />
#<br />
# scripts in the /etc/NetworkManager/dispatcher.d/ directory<br />
# are called alphabetically and are passed two parameters:<br />
# $1 is the interface name, and $2 is “up” or “down” as the<br />
# case may be.<br />
<br />
resolvconf='/etc/resolv.conf';<br />
cat "$resolvconf"{.head,,.tail} 2>/dev/null > "$resolvconf".tmp<br />
mv -f "$resolvconf".tmp "$resolvconf"<br />
</pre><br />
<br />
===DHCP problems===<br />
If you have problems with getting an IP via DHCP try to add the following to your {{Filename|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{Codeline|aa:bb:cc:dd:ee:ff}} is the MAC-adress of this NIC.<br />
<br />
===How to bypass Gnome keyring for normal users connecting with wireless===<br />
It's super simple! First, create a group called '''networkmanager''' with the following command (or any other method you prefer):<br />
# groupadd networkmanager<br />
<br />
Then add your user to that group using the following command (or any other preferred method):<br />
# gpasswd -a username networkmanager<br />
Replace username in the above command with your actual username.<br />
<br />
Now, as root, launch nm-connection-editor and configure the connections:<br />
# nm-connection-editor<br />
Put a check mark next to "Available to all users" and apply the settings. <br />
<br />
Now you won't be bothered by Gnome keyring! ''(citation needed)''<br />
Also, if you additionally enable "connect automatically", your connection will be available and connected before you even log in to your desktop, making your whole startup process even faster!<br />
<br />
===Missing default route===<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
===3G modem not detected===<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
[http://www.archlinux.org/packages/extra/i686/modemmanager/ modemmanager] package using {{Codeline|pacman -S modemmanager}} and restart NetworkManager daemon with {{Codeline|/etc/rc.d/networkmanager restart}}. Replug your modem or restart. This utility provides support for hardware not in networkmanager's default database.<br />
<br />
===VPN problems in Networkmanager 0.7.999===<br />
If you get the error message "invalid secrets" when trying to connect to your VPN provider using the PPTP protocol, try installing the git versions instead: [http://aur.archlinux.org/packages.php?ID=22349 networkmanager], [http://aur.archlinux.org/packages.php?ID=26516 nm-applet] and the [http://aur.archlinux.org/packages.php?ID=29178 pptp plugin].<br />
<br />
===PolicyKit issues===<br />
{{Note|Following is probably not need for KDE 4 anymore, as there should be PolicyKit integration as of KDE 4.3. At least with knetworkmanager from [kdemod-core], the author did not run into any troubles.}}<br />
<br />
Because many Display Managers (including KDM) do not natively support policykit at login, you will run into some permission issues with D-Bus and NetworkManager.<br />
<br />
While there are several options to resolve this issue, choose ''only'' one:<br />
<br />
* Install Consolekit and add the following line to {{Filename|/etc/pam.d/kde}}:<br />
session optional pam_ck_connector.so<br />
{{Warning|This may cause the malfunction of KDE PowerDevil.}}<br />
<br />
* exec ck-launch-session wm<br />
<br />
* Put the following script in ~/.kde4/Autostart or similar for other WMs or DEs:<br />
#!/bin/bash<br />
ck-launch-session<br />
<br />
===Switching off WLAN on laptops===<br />
<br />
Sometimes networkmanager won't work when you disable your Wifi-adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with rfkill. Install rfkill from the repo:<br />
<br />
# pacman -S rfkill<br />
<br />
and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies rfkill about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
===Static IP Settings Revert To DHCP===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, nm-applet may not properly store the configuration change, and will revert to automatic DHCP. A workaround for this issue follows.<br />
<br />
Edit the default connection (eg "Auto eth0") in nm-applet. Change the connection name (eg "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click Apply. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run<br />
<br />
$ sudo nm-connection-editor # you must use sudo, not su<br />
<br />
In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click Apply and close the connection editor.<br />
<br />
==Tips and tricks==<br />
<br />
===Checking if networking is up inside a cron job or script===<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's '''nm-tool''' and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a cron.hourly script that runs '''fpupdate''' for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from '''nm-tool'''; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
===Automatically unlock keyring after login===<br />
==== Gnome ====<br />
# Right click on the NM icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
''*In {{Filename|/etc/pam.d/gdm}} (or your corresponding daemon in /etc/pam.d), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
*In {{Filename|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.''<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using kde / kdm, you can use pam-keyring-tool from the AUR.}}<br />
<br />
*Put a script like the following in ~/.kde4/Autostart:<br />
$!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
:Similar should work with openbox, lxde, etc.<br />
<br />
===Automatically connect on boot ===<br />
Since version 0.7 the NetworkManager is able to connect on boot, before a user has logged in and unlocked the keyring.<br />
<br />
*First make sure that the keyfile plugin is loaded; {{Filename|/etc/NetworkManager/NetworkManager.conf}} should look like this:<br />
[main]<br />
plugins=keyfile<br />
<br />
*If this was not in the file before, you have to restart '''nm-system-settings''':<br />
# killall -TERM nm-system-settings<br />
:or simply reboot.<br />
<br />
*Now grant your user the right to modify system-connections:<br />
<br />
With <b>polkit</b>:<br />
<br />
Place the following in /etc/polkit-1/localauthority/50-local.d/10-org-freedesktop-network-manager-settings.pkla<br />
<br />
<pre><br />
[Allow user YOURUSERNAME to create wireless connections for all users]<br />
Identity=unix-user:YOURUSERNAME<br />
Action=org.freedesktop.network-manager-settings.system.modify<br />
ResultAny=no<br />
ResultInactive=no<br />
ResultActive=yes<br />
</pre><br />
<br />
:Finally, in the connection-editor (of the gnome applet), check the '''Available to all users''' box.<br />
<br />
The connection is now saved in '''/etc/NetworkManager/system-connections/"CONNECTION NAME"'''. On reboot, NetworkManager will try to connect to it, when in range.<br />
<br />
{{Note|1=As per [https://bugs.kde.org/show_bug.cgi?id=204340 this] bug report, <tt>knetworkmanager</tt> does not yet implement this feature. You will need to use the GNOME network applet (<tt>nm-applet</tt>). Install it as described above in this page, <tt>"killall knetworkmanager"</tt>, then start <tt>nm-applet</tt>.<br />
<br>Please vote for the bug!}}<br />
<br />
===Ignore specific devices===<br />
Sometimes it is desired, that network manager ignores some devices and do not try to get an IP.<br />
<br />
*First you have to find out the Hal UDI (e.g. with lshal):<br />
...<br />
info.product = 'Networking Interface' (string)<br />
info.subsystem = 'net' (string)<br />
info.udi = '/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55' (string)<br />
linux.hotplug_type = 2 (0x2) (int)<br />
linux.subsystem = 'net' (string)<br />
...<br />
<br />
*Add the udi to /etc/NetworkManager/nm-system-settings.conf:<br />
[keyfile]<br />
unmanaged-devices=/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55<br />
<br />
:Multiple devices can be specified, delimited by semicolons:<br />
<br />
[keyfile]<br />
unmanaged-devices=/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55;/org/freedesktop/Hal/devices/net_00_2c_6d_e2_08_af<br />
<br />
You do not need to restart NetworkManager for the changes to take effect.<br />
<br />
*Ignoring a type of device at boot time.<br />
this script was used to ignore all ethernet devices at boot time of a archiso build, it can be changed to ignore wifi devices etc.<br />
/!\being used on a non-persistant filesystem, the nm-system-settings.conf is default at run time<br />
#!/bin/sh<br />
# author: tim noise <darknoise@drkns.net><br />
COUNT=0<br />
TARGET_FILE="/etc/NetworkManager/nm-system-settings.conf"<br />
for i in `lshal | grep -A6 'Networking Interface' | awk -F "'" '/info.udi = / {print $2}'`; do<br />
if [ $COUNT = 0 ]; then<br />
COUNT=$COUNT+1;<br />
echo "unmanaged-devices=$i" >> $TARGET_FILE<br />
else<br />
echo -n ";$i" >> $TARGET_FILE<br />
fi<br />
done<br />
printf "\n" >> $TARGET_FILE</div>Greenifhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=126029NetworkManager2010-12-26T16:01:17Z<p>Greenif: /* Network Services with NetworkManager Dispatcher */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NetworkManager}}<br />
[[de:Networkmanager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Wireless Setup}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to be able to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by RedHat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager is available in the official repositories:<br />
<br />
# pacman -S networkmanager<br />
<br />
== Graphical Front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's applet (formerly gnome-network-manager) is lightweight enough and works across all environments:<br />
<br />
# pacman -S network-manager-applet<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users":<br />
<br />
# pacman -S gnome-keyring<br />
<br />
=== KDE4 ===<br />
<br />
The KNetworkManager front-end has been made available in KDE version 4.4 as a plasma widget:<br />
<br />
# pacman -S kdeplasma-applets-networkmanagement<br />
<br />
The GNOME counterpart works just as nicely, or even better (has more features and detects more hardware).<br />
<br />
{{Note|If you are changing from another network managing tool like Wicd, do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
=== KDE3 ===<br />
<br />
Though no longer supported, {{Package AUR|knetworkmanager}} is in the [[AUR]]. Package name:<br />
knetworkmanager<br />
<br />
=== Openbox ===<br />
<br />
The GNOME applet with the xfce4-notifyd notification daemon works well:<br />
<br />
# pacman -S network-manager-applet xfce4-notifyd hicolor-icon-theme gnome-icon-theme<br />
<br />
If you want to store authentication details (Wireless/DSL):<br />
<br />
# pacman -S gnome-keyring<br />
<br />
To prevent nm-applet dbus errors, edit ~/.xinitrc and change "exec openbox-session" to<br />
"exec ck-launch-session openbox-session".<br />
<br />
To have Openbox's autostart.sh start nm-applet properly, you may need to delete the file /etc/xdg/autostart/nm-applet.desktop (You may need to delete this file again after every update to network-manager-applet)<br />
<br />
Then in autostart.sh, start nm-applet with this line:<br />
<br />
(sleep 3 && /usr/bin/nm-applet --sm-disable) &<br />
<br />
=== Other Desktops and Window Managers ===<br />
<br />
It is recommended to use the GNOME applet. You'll also need to be sure that the GNOME hicolor theme is installed to be able to display the applet:<br />
<br />
# pacman -S hicolor-icon-theme gnome-icon-theme<br />
<br />
=== Command line ===<br />
<br />
cnetworkmanager, which is now available in the community repository, can be used to configure connections from the command line.<br />
<br />
# pacman -S cnetworkmanager<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{Filename|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{Filename|/etc/hosts}}:<br />
<br />
<pre><br />
#<ip-address> <hostname.domain.org> <hostname> <br />
127.0.0.1 localhost.localdomain localhost dell-latitude<br />
</pre><br />
<br />
=== Disable current network setup ===<br />
<br />
You'll want to disable your current network setup to be able to properly test NetworkManager. First (if using the Arch Linux network scripts) stop the network:<br />
<br />
/etc/rc.d/network stop<br />
<br />
Bring down your NIC's (Network Interface Controllers, i.e. network cards). For example:<br />
<br />
ifconfig eth0 down<br />
ifconfig wlan0 down<br />
<br />
Edit {{Filename|/etc/rc.conf}} and where you defined DHCP or a static IP address, comment them out:<br />
<br />
<pre><br />
#eth0="dhcp" <br />
#wlan0="dhcp" <br />
INTERFACES=(!eth0 !wlan0)<br />
</pre><br />
<br />
=== Edit daemons ===<br />
<br />
You must ''remove'' the default '''network''' daemon and add the '''networkmanager''' daemon, after the dbus daemon:<br />
<br />
DAEMONS=( ...'''dbus networkmanager'''... )<br />
<br />
Be sure that the package {{Package Official|dbus}} is installed as NetworkManager will require it. To start other services (daemons) that require a network connection see the next section on how to set them up. Though the NetworkManager daemon has been started here, it will not (by default) connect onto a network until an applet is loaded and the applet specifies to do so. This means that networking services will need to be specified to NetworkManager on when to run.<br />
<br />
=== Network Services with NetworkManager Dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are '''openntpd''' and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network (interface up), and stop them when you are no longer using them (interface down).<br />
<br />
To use this feature, scripts can be added to the {{Filename|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it's good practice to make them owned by '''root:root''' and writable only by the owner.<br />
{{Warning|For security reason. You should disable write access for group and other. For example use 755 mask. In other case it can refuse to execute script.}}<br />
<br />
The scripts will be run in alphabetical order at connection time (with arguments ''interface up''), and in reverse alphabetical order at disconnect time (''interface down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{Filename|10_portmap}} or {{Filename|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
The following starts openntpd when an interface is brought up. Save the file as {{Filename|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<pre><br />
#!/bin/sh<br />
<br />
INTERFACE=$1 # The interface which is brought up or down<br />
STATUS=$2 # The new state of the interface<br />
<br />
case "$STATUS" in<br />
'up') # $INTERFACE is up<br />
exec /etc/rc.d/openntpd start<br />
;;<br />
'down') # $INTERFACE is down<br />
# Check for active interface and down if no one active<br />
if [ ! `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
exec /etc/rc.d/openntpd stop<br />
fi<br />
;;<br />
esac<br />
</pre><br />
<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Use dispatcher to connect to a vpn after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a vpn-connection we defined previously with NetworkManager. First thing to to is to create the dispatcher-script that defines what to do after we connected to the network.<br />
<br />
1. Create the dispatcher script in {{Filename|/etc/NetworkManager/dispatcher.d/vpn-up}}<br />
<br />
case "$2" in<br />
up)<br />
sudo -u username DISPLAY=:0 /usr/bin/python /etc/NetworkManager/vpn-up.py<br />
;;<br />
esac<br />
<br />
Remember to make it executable with chmod +x and change '''username''' to the right one.<br />
<br />
2. Create the {{Filename|/etc/NetworkManager/vpn-up.py}} and change '''network-ESSID''' to the desired one. You'll find the code [http://dpaste.com/hold/203441/ here].<br />
<br />
Now NetworkManager should try to connect to your vpn which you had defined in your profile.<br />
<br />
=== Proxy settings ===<br />
<br />
Network Manager does not directly handle proxy settings.<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. First start the daemon:<br />
<br />
/etc/rc.d/networkmanager start<br />
<br />
Some applets will provide you with a .desktop file so that the NetworkManager applet can be loaded through the application menu. If it doesn't, you're going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant Window Managers like Awesome:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
==Troubleshooting==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Network Management Disabled ===<br />
<br />
Sometimes when NM shuts down the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'l have to remove it manually:<br />
<br />
rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{Filename|etc/rc.local}} to have it removed upon bootup:<br />
<br />
<pre>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</pre><br />
<br />
=== NetworkManager prevents DHCPCD from using resolv.conf.head and resolv.conf.tail ===<br />
<br />
Sometimes it's problematic to add static items to resolv.conf when it's constantly rewritten by nm and dhcpcd. You can use networkmanager-dhclient package from AUR but a better solution is to use this simple script:<br />
<br />
<pre><br />
#!/bin/bash<br />
# <br />
# /etc/NetworkManager/dispatcher.d/99-resolv.conf-head_and_tail<br />
# Include /etc/resolv.conf.head and /etc/resolv.conf.tail to /etc/resolv.conf<br />
#<br />
# scripts in the /etc/NetworkManager/dispatcher.d/ directory<br />
# are called alphabetically and are passed two parameters:<br />
# $1 is the interface name, and $2 is “up” or “down” as the<br />
# case may be.<br />
<br />
resolvconf='/etc/resolv.conf';<br />
cat "$resolvconf"{.head,,.tail} 2>/dev/null > "$resolvconf".tmp<br />
mv -f "$resolvconf".tmp "$resolvconf"<br />
</pre><br />
<br />
===DHCP problems===<br />
If you have problems with getting an IP via DHCP try to add the following to your {{Filename|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{Codeline|aa:bb:cc:dd:ee:ff}} is the MAC-adress of this NIC.<br />
<br />
===How to bypass Gnome keyring for normal users connecting with wireless===<br />
It's super simple! First, create a group called '''networkmanager''' with the following command (or any other method you prefer):<br />
# groupadd networkmanager<br />
<br />
Then add your user to that group using the following command (or any other preferred method):<br />
# gpasswd -a username networkmanager<br />
Replace username in the above command with your actual username.<br />
<br />
Now, as root, launch nm-connection-editor and configure the connections:<br />
# nm-connection-editor<br />
Put a check mark next to "Available to all users" and apply the settings. <br />
<br />
Now you won't be bothered by Gnome keyring! ''(citation needed)''<br />
Also, if you additionally enable "connect automatically", your connection will be available and connected before you even log in to your desktop, making your whole startup process even faster!<br />
<br />
===Missing default route===<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
===3G modem not detected===<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
[http://www.archlinux.org/packages/extra/i686/modemmanager/ modemmanager] package using {{Codeline|pacman -S modemmanager}} and restart NetworkManager daemon with {{Codeline|/etc/rc.d/networkmanager restart}}. Replug your modem or restart. This utility provides support for hardware not in networkmanager's default database.<br />
<br />
===VPN problems in Networkmanager 0.7.999===<br />
If you get the error message "invalid secrets" when trying to connect to your VPN provider using the PPTP protocol, try installing the git versions instead: [http://aur.archlinux.org/packages.php?ID=22349 networkmanager], [http://aur.archlinux.org/packages.php?ID=26516 nm-applet] and the [http://aur.archlinux.org/packages.php?ID=29178 pptp plugin].<br />
<br />
===PolicyKit issues===<br />
{{Note|Following is probably not need for KDE 4 anymore, as there should be PolicyKit integration as of KDE 4.3. At least with knetworkmanager from [kdemod-core], the author did not run into any troubles.}}<br />
<br />
Because many Display Managers (including KDM) do not natively support policykit at login, you will run into some permission issues with D-Bus and NetworkManager.<br />
<br />
While there are several options to resolve this issue, choose ''only'' one:<br />
<br />
* Install Consolekit and add the following line to {{Filename|/etc/pam.d/kde}}:<br />
session optional pam_ck_connector.so<br />
{{Warning|This may cause the malfunction of KDE PowerDevil.}}<br />
<br />
* exec ck-launch-session wm<br />
<br />
* Put the following script in ~/.kde4/Autostart or similar for other WMs or DEs:<br />
#!/bin/bash<br />
ck-launch-session<br />
<br />
===Switching off WLAN on laptops===<br />
<br />
Sometimes networkmanager won't work when you disable your Wifi-adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with rfkill. Install rfkill from the repo:<br />
<br />
# pacman -S rfkill<br />
<br />
and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies rfkill about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
===Static IP Settings Revert To DHCP===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, nm-applet may not properly store the configuration change, and will revert to automatic DHCP. A workaround for this issue follows.<br />
<br />
Edit the default connection (eg "Auto eth0") in nm-applet. Change the connection name (eg "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click Apply. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run<br />
<br />
$ sudo nm-connection-editor # you must use sudo, not su<br />
<br />
In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click Apply and close the connection editor.<br />
<br />
==Tips and tricks==<br />
<br />
===Checking if networking is up inside a cron job or script===<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's '''nm-tool''' and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a cron.hourly script that runs '''fpupdate''' for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from '''nm-tool'''; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
===Automatically unlock keyring after login===<br />
==== Gnome ====<br />
# Right click on the NM icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
''*In {{Filename|/etc/pam.d/gdm}} (or your corresponding daemon in /etc/pam.d), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
*In {{Filename|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.''<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using kde / kdm, you can use pam-keyring-tool from the AUR.}}<br />
<br />
*Put a script like the following in ~/.kde4/Autostart:<br />
$!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
:Similar should work with openbox, lxde, etc.<br />
<br />
===Automatically connect on boot ===<br />
Since version 0.7 the NetworkManager is able to connect on boot, before a user has logged in and unlocked the keyring.<br />
<br />
*First make sure that the keyfile plugin is loaded; {{Filename|/etc/NetworkManager/NetworkManager.conf}} should look like this:<br />
[main]<br />
plugins=keyfile<br />
<br />
*If this was not in the file before, you have to restart '''nm-system-settings''':<br />
# killall -TERM nm-system-settings<br />
:or simply reboot.<br />
<br />
*Now grant your user the right to modify system-connections:<br />
<br />
With <b>polkit</b>:<br />
<br />
Place the following in /etc/polkit-1/localauthority/50-local.d/10-org-freedesktop-network-manager-settings.pkla<br />
<br />
<pre><br />
[Allow user YOURUSERNAME to create wireless connections for all users]<br />
Identity=unix-user:YOURUSERNAME<br />
Action=org.freedesktop.network-manager-settings.system.modify<br />
ResultAny=no<br />
ResultInactive=no<br />
ResultActive=yes<br />
</pre><br />
<br />
:Finally, in the connection-editor (of the gnome applet), check the '''Available to all users''' box.<br />
<br />
The connection is now saved in '''/etc/NetworkManager/system-connections/"CONNECTION NAME"'''. On reboot, NetworkManager will try to connect to it, when in range.<br />
<br />
{{Note|1=As per [https://bugs.kde.org/show_bug.cgi?id=204340 this] bug report, <tt>knetworkmanager</tt> does not yet implement this feature. You will need to use the GNOME network applet (<tt>nm-applet</tt>). Install it as described above in this page, <tt>"killall knetworkmanager"</tt>, then start <tt>nm-applet</tt>.<br />
<br>Please vote for the bug!}}<br />
<br />
===Ignore specific devices===<br />
Sometimes it is desired, that network manager ignores some devices and do not try to get an IP.<br />
<br />
*First you have to find out the Hal UDI (e.g. with lshal):<br />
...<br />
info.product = 'Networking Interface' (string)<br />
info.subsystem = 'net' (string)<br />
info.udi = '/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55' (string)<br />
linux.hotplug_type = 2 (0x2) (int)<br />
linux.subsystem = 'net' (string)<br />
...<br />
<br />
*Add the udi to /etc/NetworkManager/nm-system-settings.conf:<br />
[keyfile]<br />
unmanaged-devices=/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55<br />
<br />
:Multiple devices can be specified, delimited by semicolons:<br />
<br />
[keyfile]<br />
unmanaged-devices=/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55;/org/freedesktop/Hal/devices/net_00_2c_6d_e2_08_af<br />
<br />
You do not need to restart NetworkManager for the changes to take effect.<br />
<br />
*Ignoring a type of device at boot time.<br />
this script was used to ignore all ethernet devices at boot time of a archiso build, it can be changed to ignore wifi devices etc.<br />
/!\being used on a non-persistant filesystem, the nm-system-settings.conf is default at run time<br />
#!/bin/sh<br />
# author: tim noise <darknoise@drkns.net><br />
COUNT=0<br />
TARGET_FILE="/etc/NetworkManager/nm-system-settings.conf"<br />
for i in `lshal | grep -A6 'Networking Interface' | awk -F "'" '/info.udi = / {print $2}'`; do<br />
if [ $COUNT = 0 ]; then<br />
COUNT=$COUNT+1;<br />
echo "unmanaged-devices=$i" >> $TARGET_FILE<br />
else<br />
echo -n ";$i" >> $TARGET_FILE<br />
fi<br />
done<br />
printf "\n" >> $TARGET_FILE</div>Greenifhttps://wiki.archlinux.org/index.php?title=NetworkManager&diff=126028NetworkManager2010-12-26T15:59:16Z<p>Greenif: /* Network Services with NetworkManager Dispatcher */</p>
<hr />
<div>[[Category:Networking (English)]]<br />
[[Category:HOWTOs (English)]]<br />
{{i18n|NetworkManager}}<br />
[[de:Networkmanager]]<br />
{{Article summary start}}<br />
{{Article summary text|Covers installation and configuration of NetworkManager &ndash; a set of co-operative tools that make networking simple and straightforward.}}<br />
{{Article summary heading|Related}}<br />
{{Article summary wiki|Wireless Setup}}<br />
{{Article summary end}}<br />
<br />
[http://projects.gnome.org/NetworkManager/ NetworkManager] is a program for providing detection and configuration for systems to automatically connect to network. NetworkManager's functionality can be useful for both wireless and wired networks. For wireless networks, NetworkManager prefers known wireless networks and has the ability to be able to switch to the most reliable network. NetworkManager-aware applications can switch from online and offline mode. NetworkManager also prefers wired connections over wireless ones, has support for modem connections and certain types of VPN. NetworkManager was originally developed by RedHat and now is hosted by the [[GNOME]] project.<br />
<br />
== Base install ==<br />
<br />
NetworkManager is available in the official repositories:<br />
<br />
# pacman -S networkmanager<br />
<br />
== Graphical Front-ends ==<br />
<br />
To configure and have easy access to NetworkManager most people will want to install an applet. This GUI front-end usually resides in the system tray (or notification area) and allows network selection and configuration of NetworkManager. Various applets exist for different types of desktops.<br />
<br />
=== GNOME ===<br />
<br />
GNOME's applet (formerly gnome-network-manager) is lightweight enough and works across all environments:<br />
<br />
# pacman -S network-manager-applet<br />
<br />
If you want to store authentication details (Wireless/DSL) and enable global connection settings, i.e "available to all users":<br />
<br />
# pacman -S gnome-keyring<br />
<br />
=== KDE4 ===<br />
<br />
The KNetworkManager front-end has been made available in KDE version 4.4 as a plasma widget:<br />
<br />
# pacman -S kdeplasma-applets-networkmanagement<br />
<br />
The GNOME counterpart works just as nicely, or even better (has more features and detects more hardware).<br />
<br />
{{Note|If you are changing from another network managing tool like Wicd, do not forget to set the default 'Network Management Backend' in <br />
System Settings -> Hardware -> Information Sources}}<br />
<br />
=== KDE3 ===<br />
<br />
Though no longer supported, {{Package AUR|knetworkmanager}} is in the [[AUR]]. Package name:<br />
knetworkmanager<br />
<br />
=== Openbox ===<br />
<br />
The GNOME applet with the xfce4-notifyd notification daemon works well:<br />
<br />
# pacman -S network-manager-applet xfce4-notifyd hicolor-icon-theme gnome-icon-theme<br />
<br />
If you want to store authentication details (Wireless/DSL):<br />
<br />
# pacman -S gnome-keyring<br />
<br />
To prevent nm-applet dbus errors, edit ~/.xinitrc and change "exec openbox-session" to<br />
"exec ck-launch-session openbox-session".<br />
<br />
To have Openbox's autostart.sh start nm-applet properly, you may need to delete the file /etc/xdg/autostart/nm-applet.desktop (You may need to delete this file again after every update to network-manager-applet)<br />
<br />
Then in autostart.sh, start nm-applet with this line:<br />
<br />
(sleep 3 && /usr/bin/nm-applet --sm-disable) &<br />
<br />
=== Other Desktops and Window Managers ===<br />
<br />
It is recommended to use the GNOME applet. You'll also need to be sure that the GNOME hicolor theme is installed to be able to display the applet:<br />
<br />
# pacman -S hicolor-icon-theme gnome-icon-theme<br />
<br />
=== Command line ===<br />
<br />
cnetworkmanager, which is now available in the community repository, can be used to configure connections from the command line.<br />
<br />
# pacman -S cnetworkmanager<br />
<br />
== Configuration ==<br />
<br />
NetworkManager will require some additional steps to be able run properly.<br />
<br />
Verify that your {{Filename|/etc/hosts}} is correct before continuing. If you previously tried to connect before doing this step, NetworkManager may have altered it. An example hostname line in {{Filename|/etc/hosts}}:<br />
<br />
<pre><br />
#<ip-address> <hostname.domain.org> <hostname> <br />
127.0.0.1 localhost.localdomain localhost dell-latitude<br />
</pre><br />
<br />
=== Disable current network setup ===<br />
<br />
You'll want to disable your current network setup to be able to properly test NetworkManager. First (if using the Arch Linux network scripts) stop the network:<br />
<br />
/etc/rc.d/network stop<br />
<br />
Bring down your NIC's (Network Interface Controllers, i.e. network cards). For example:<br />
<br />
ifconfig eth0 down<br />
ifconfig wlan0 down<br />
<br />
Edit {{Filename|/etc/rc.conf}} and where you defined DHCP or a static IP address, comment them out:<br />
<br />
<pre><br />
#eth0="dhcp" <br />
#wlan0="dhcp" <br />
INTERFACES=(!eth0 !wlan0)<br />
</pre><br />
<br />
=== Edit daemons ===<br />
<br />
You must ''remove'' the default '''network''' daemon and add the '''networkmanager''' daemon, after the dbus daemon:<br />
<br />
DAEMONS=( ...'''dbus networkmanager'''... )<br />
<br />
Be sure that the package {{Package Official|dbus}} is installed as NetworkManager will require it. To start other services (daemons) that require a network connection see the next section on how to set them up. Though the NetworkManager daemon has been started here, it will not (by default) connect onto a network until an applet is loaded and the applet specifies to do so. This means that networking services will need to be specified to NetworkManager on when to run.<br />
<br />
=== Network Services with NetworkManager Dispatcher===<br />
<br />
There are quite a few network services that you will not want running until NetworkManager brings up an interface. Good examples are '''openntpd''' and network filesystem mounts of various types (e.g. '''netfs'''). NetworkManager has the ability to start these services when you connect to a network (interface up), and stop them when you are no longer using them (interface down).<br />
<br />
To use this feature, scripts can be added to the {{Filename|/etc/NetworkManager/dispatcher.d}} directory. These scripts will need to have executable, user permissions. For security, it's good practice to make them owned by '''root:root''' and writable only by the owner.<br />
{{Warning|By security reason. It should be disable write access for group and other. For example use 755 mask. In other case it can refuse to execute script.}}<br />
<br />
The scripts will be run in alphabetical order at connection time (with arguments ''interface up''), and in reverse alphabetical order at disconnect time (''interface down''). To ensure what order they come up in, it is common to use numerical characters prior to the name of the script (e.g. {{Filename|10_portmap}} or {{Filename|30_netfs}} (which ensures that the portmapper is up before NFS mounts are attempted).<br />
<br />
The following starts openntpd when an interface is brought up. Save the file as {{Filename|/etc/NetworkManager/dispatcher.d/20_openntpd}} and make it executable.<br />
<pre><br />
#!/bin/sh<br />
<br />
INTERFACE=$1 # The interface which is brought up or down<br />
STATUS=$2 # The new state of the interface<br />
<br />
case "$STATUS" in<br />
'up') # $INTERFACE is up<br />
exec /etc/rc.d/openntpd start<br />
;;<br />
'down') # $INTERFACE is down<br />
# Check for active interface and down if no one active<br />
if [ ! `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
exec /etc/rc.d/openntpd stop<br />
fi<br />
;;<br />
esac<br />
</pre><br />
<br />
{{Warning|if you connect to foreign or public networks, be aware of what services you are starting and what servers you expect to be available for them to connect to. You could make a security hole by starting the wrong services while connected to a public network.}}<br />
<br />
==== Use dispatcher to connect to a vpn after a network-connection is established ====<br />
<br />
In this example we want to connect automatically to a vpn-connection we defined previously with NetworkManager. First thing to to is to create the dispatcher-script that defines what to do after we connected to the network.<br />
<br />
1. Create the dispatcher script in {{Filename|/etc/NetworkManager/dispatcher.d/vpn-up}}<br />
<br />
case "$2" in<br />
up)<br />
sudo -u username DISPLAY=:0 /usr/bin/python /etc/NetworkManager/vpn-up.py<br />
;;<br />
esac<br />
<br />
Remember to make it executable with chmod +x and change '''username''' to the right one.<br />
<br />
2. Create the {{Filename|/etc/NetworkManager/vpn-up.py}} and change '''network-ESSID''' to the desired one. You'll find the code [http://dpaste.com/hold/203441/ here].<br />
<br />
Now NetworkManager should try to connect to your vpn which you had defined in your profile.<br />
<br />
=== Proxy settings ===<br />
<br />
Network Manager does not directly handle proxy settings.<br />
<br />
See: [[Proxy settings]]<br />
<br />
== Testing ==<br />
<br />
NetworkManager applets are designed to load upon login so no further configuration should be necessary for most users. If you have already disabled your previous network settings and disconnected from your network, you can now test if NetworkManager will work. First start the daemon:<br />
<br />
/etc/rc.d/networkmanager start<br />
<br />
Some applets will provide you with a .desktop file so that the NetworkManager applet can be loaded through the application menu. If it doesn't, you're going to either have to discover the command to use or logout and login again to start the applet. Once the applet is started, it will likely begin polling network connections with for auto-configuration with a DHCP server.<br />
<br />
To start the GNOME applet in non-xdg-compliant Window Managers like Awesome:<br />
<br />
nm-applet --sm-disable &<br />
<br />
For static IPs you will have to configure NetworkManager to understand them. The process usually involves right-clicking the applet and selecting something like 'Edit Connections'.<br />
<br />
==Troubleshooting==<br />
<br />
Some fixes to common problems.<br />
<br />
=== Network Management Disabled ===<br />
<br />
Sometimes when NM shuts down the pid (state) file does not get removed and you will get a 'Network management disabled' message. If this happens, you'l have to remove it manually:<br />
<br />
rm /var/lib/NetworkManager/NetworkManager.state<br />
<br />
If this happens upon reboot, you can add an action to your {{Filename|etc/rc.local}} to have it removed upon bootup:<br />
<br />
<pre>nmpid=/var/lib/NetworkManager/NetworkManager.state<br />
[ -f $nmpid ] && rm $nmpid</pre><br />
<br />
=== NetworkManager prevents DHCPCD from using resolv.conf.head and resolv.conf.tail ===<br />
<br />
Sometimes it's problematic to add static items to resolv.conf when it's constantly rewritten by nm and dhcpcd. You can use networkmanager-dhclient package from AUR but a better solution is to use this simple script:<br />
<br />
<pre><br />
#!/bin/bash<br />
# <br />
# /etc/NetworkManager/dispatcher.d/99-resolv.conf-head_and_tail<br />
# Include /etc/resolv.conf.head and /etc/resolv.conf.tail to /etc/resolv.conf<br />
#<br />
# scripts in the /etc/NetworkManager/dispatcher.d/ directory<br />
# are called alphabetically and are passed two parameters:<br />
# $1 is the interface name, and $2 is “up” or “down” as the<br />
# case may be.<br />
<br />
resolvconf='/etc/resolv.conf';<br />
cat "$resolvconf"{.head,,.tail} 2>/dev/null > "$resolvconf".tmp<br />
mv -f "$resolvconf".tmp "$resolvconf"<br />
</pre><br />
<br />
===DHCP problems===<br />
If you have problems with getting an IP via DHCP try to add the following to your {{Filename|/etc/dhclient.conf}}:<br />
interface "eth0" {<br />
send dhcp-client-identifier 01:aa:bb:cc:dd:ee:ff;<br />
}<br />
Where {{Codeline|aa:bb:cc:dd:ee:ff}} is the MAC-adress of this NIC.<br />
<br />
===How to bypass Gnome keyring for normal users connecting with wireless===<br />
It's super simple! First, create a group called '''networkmanager''' with the following command (or any other method you prefer):<br />
# groupadd networkmanager<br />
<br />
Then add your user to that group using the following command (or any other preferred method):<br />
# gpasswd -a username networkmanager<br />
Replace username in the above command with your actual username.<br />
<br />
Now, as root, launch nm-connection-editor and configure the connections:<br />
# nm-connection-editor<br />
Put a check mark next to "Available to all users" and apply the settings. <br />
<br />
Now you won't be bothered by Gnome keyring! ''(citation needed)''<br />
Also, if you additionally enable "connect automatically", your connection will be available and connected before you even log in to your desktop, making your whole startup process even faster!<br />
<br />
===Missing default route===<br />
On at least one KDE4 system, no default route was created when establishing wireless connections with NetworkManager. Changing the route settings of the wireless connection to remove the default selection "Use only for resources on this connection" solved the issue.<br />
<br />
===3G modem not detected===<br />
If NetworkManager (from v0.7.999) does not detect your 3G modem, but you still can connect using [[wvdial]], try installing <br />
[http://www.archlinux.org/packages/extra/i686/modemmanager/ modemmanager] package using {{Codeline|pacman -S modemmanager}} and restart NetworkManager daemon with {{Codeline|/etc/rc.d/networkmanager restart}}. Replug your modem or restart. This utility provides support for hardware not in networkmanager's default database.<br />
<br />
===VPN problems in Networkmanager 0.7.999===<br />
If you get the error message "invalid secrets" when trying to connect to your VPN provider using the PPTP protocol, try installing the git versions instead: [http://aur.archlinux.org/packages.php?ID=22349 networkmanager], [http://aur.archlinux.org/packages.php?ID=26516 nm-applet] and the [http://aur.archlinux.org/packages.php?ID=29178 pptp plugin].<br />
<br />
===PolicyKit issues===<br />
{{Note|Following is probably not need for KDE 4 anymore, as there should be PolicyKit integration as of KDE 4.3. At least with knetworkmanager from [kdemod-core], the author did not run into any troubles.}}<br />
<br />
Because many Display Managers (including KDM) do not natively support policykit at login, you will run into some permission issues with D-Bus and NetworkManager.<br />
<br />
While there are several options to resolve this issue, choose ''only'' one:<br />
<br />
* Install Consolekit and add the following line to {{Filename|/etc/pam.d/kde}}:<br />
session optional pam_ck_connector.so<br />
{{Warning|This may cause the malfunction of KDE PowerDevil.}}<br />
<br />
* exec ck-launch-session wm<br />
<br />
* Put the following script in ~/.kde4/Autostart or similar for other WMs or DEs:<br />
#!/bin/bash<br />
ck-launch-session<br />
<br />
===Switching off WLAN on laptops===<br />
<br />
Sometimes networkmanager won't work when you disable your Wifi-adapter with a switch on your laptop and try to enable it again afterwards. This is often a problem with rfkill. Install rfkill from the repo:<br />
<br />
# pacman -S rfkill<br />
<br />
and use <br />
<br />
$ watch -n1 rfkill list all<br />
<br />
to check if the driver notifies rfkill about the wireless adapter's status.<br />
If one identifier stays blocked after you switch on the adapter you could try to manually unblock it with (where X is the number of the identifier provided by the above output):<br />
<br />
# rfkill event unblock X<br />
<br />
===Static IP Settings Revert To DHCP===<br />
<br />
Due to an unresolved bug, when changing default connections to static IP, nm-applet may not properly store the configuration change, and will revert to automatic DHCP. A workaround for this issue follows.<br />
<br />
Edit the default connection (eg "Auto eth0") in nm-applet. Change the connection name (eg "my eth0"), uncheck the "Available to all users" checkbox, change your static IP settings as desired, and click Apply. This will save a new connection with the given name.<br />
<br />
Next, you will want to make the default connection not connect automatically. To do so, run<br />
<br />
$ sudo nm-connection-editor # you must use sudo, not su<br />
<br />
In the connection editor, edit the default connection (eg "Auto eth0") and uncheck "Connect automatically". Click Apply and close the connection editor.<br />
<br />
==Tips and tricks==<br />
<br />
===Checking if networking is up inside a cron job or script===<br />
Some cron jobs require networking to be up to succeed. You may wish to avoid running these jobs when the network is down. To accomplish this, add an '''if''' test for networking that queries NetworkManager's '''nm-tool''' and checks the state of networking. The test shown here succeeds if any interface is up, and fails if they are all down. This is convenient for laptops that might be hardwired, might be on wireless, or might be off the network. <br />
if [ `nm-tool|grep State|cut -f2 -d' '` == "connected" ]; then<br />
#Whatever you want to do if the network is online<br />
else<br />
#Whatever you want to do if the network is offline - note, this and the else above are optional<br />
fi<br />
<br />
This useful for a cron.hourly script that runs '''fpupdate''' for the F-Prot virus scanner signature update, as an example. Another way it might be useful, with a little modification, is to differentiate between networks using various parts of the output from '''nm-tool'''; for example, since the active wireless network is denoted with an asterisk, you could grep for the network name and then grep for a literal asterisk.<br />
<br />
===Automatically unlock keyring after login===<br />
==== Gnome ====<br />
# Right click on the NM icon in your panel and select Edit Connections and open the Wireless tab<br />
# Select the connection you want to work with and click the Edit button<br />
# Check the boxes “Connect Automatically” and “Available to all users”<br />
Log out and log back in to complete.<br />
<br />
{{Note|The following method is dated and known not to work on at least one machine!}}<br />
''*In {{Filename|/etc/pam.d/gdm}} (or your corresponding daemon in /etc/pam.d), add these lines at the end of the "auth" and "session" blocks if they do not exist already: <br />
auth optional pam_gnome_keyring.so<br />
session optional pam_gnome_keyring.so auto_start<br />
<br />
*In {{Filename|/etc/pam.d/passwd}}, use this line for the 'password' block:<br />
password optional pam_gnome_keyring.so<br />
<br />
:Next time you log in, you should be asked if you want the password to be unlocked automatically on login.''<br />
<br />
==== KDE ====<br />
{{Note|See http://live.gnome.org/GnomeKeyring/Pam for reference, and if you are using kde / kdm, you can use pam-keyring-tool from the AUR.}}<br />
<br />
*Put a script like the following in ~/.kde4/Autostart:<br />
$!/bin/sh<br />
echo PASSWORD | /usr/bin/pam-keyring-tool --unlock --keyring=default -s<br />
:Similar should work with openbox, lxde, etc.<br />
<br />
===Automatically connect on boot ===<br />
Since version 0.7 the NetworkManager is able to connect on boot, before a user has logged in and unlocked the keyring.<br />
<br />
*First make sure that the keyfile plugin is loaded; {{Filename|/etc/NetworkManager/NetworkManager.conf}} should look like this:<br />
[main]<br />
plugins=keyfile<br />
<br />
*If this was not in the file before, you have to restart '''nm-system-settings''':<br />
# killall -TERM nm-system-settings<br />
:or simply reboot.<br />
<br />
*Now grant your user the right to modify system-connections:<br />
<br />
With <b>polkit</b>:<br />
<br />
Place the following in /etc/polkit-1/localauthority/50-local.d/10-org-freedesktop-network-manager-settings.pkla<br />
<br />
<pre><br />
[Allow user YOURUSERNAME to create wireless connections for all users]<br />
Identity=unix-user:YOURUSERNAME<br />
Action=org.freedesktop.network-manager-settings.system.modify<br />
ResultAny=no<br />
ResultInactive=no<br />
ResultActive=yes<br />
</pre><br />
<br />
:Finally, in the connection-editor (of the gnome applet), check the '''Available to all users''' box.<br />
<br />
The connection is now saved in '''/etc/NetworkManager/system-connections/"CONNECTION NAME"'''. On reboot, NetworkManager will try to connect to it, when in range.<br />
<br />
{{Note|1=As per [https://bugs.kde.org/show_bug.cgi?id=204340 this] bug report, <tt>knetworkmanager</tt> does not yet implement this feature. You will need to use the GNOME network applet (<tt>nm-applet</tt>). Install it as described above in this page, <tt>"killall knetworkmanager"</tt>, then start <tt>nm-applet</tt>.<br />
<br>Please vote for the bug!}}<br />
<br />
===Ignore specific devices===<br />
Sometimes it is desired, that network manager ignores some devices and do not try to get an IP.<br />
<br />
*First you have to find out the Hal UDI (e.g. with lshal):<br />
...<br />
info.product = 'Networking Interface' (string)<br />
info.subsystem = 'net' (string)<br />
info.udi = '/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55' (string)<br />
linux.hotplug_type = 2 (0x2) (int)<br />
linux.subsystem = 'net' (string)<br />
...<br />
<br />
*Add the udi to /etc/NetworkManager/nm-system-settings.conf:<br />
[keyfile]<br />
unmanaged-devices=/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55<br />
<br />
:Multiple devices can be specified, delimited by semicolons:<br />
<br />
[keyfile]<br />
unmanaged-devices=/org/freedesktop/Hal/devices/net_00_1f_11_01_06_55;/org/freedesktop/Hal/devices/net_00_2c_6d_e2_08_af<br />
<br />
You do not need to restart NetworkManager for the changes to take effect.<br />
<br />
*Ignoring a type of device at boot time.<br />
this script was used to ignore all ethernet devices at boot time of a archiso build, it can be changed to ignore wifi devices etc.<br />
/!\being used on a non-persistant filesystem, the nm-system-settings.conf is default at run time<br />
#!/bin/sh<br />
# author: tim noise <darknoise@drkns.net><br />
COUNT=0<br />
TARGET_FILE="/etc/NetworkManager/nm-system-settings.conf"<br />
for i in `lshal | grep -A6 'Networking Interface' | awk -F "'" '/info.udi = / {print $2}'`; do<br />
if [ $COUNT = 0 ]; then<br />
COUNT=$COUNT+1;<br />
echo "unmanaged-devices=$i" >> $TARGET_FILE<br />
else<br />
echo -n ";$i" >> $TARGET_FILE<br />
fi<br />
done<br />
printf "\n" >> $TARGET_FILE</div>Greenifhttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=117447Synchronization and backup programs (Русский)2010-09-15T23:05:28Z<p>Greenif: </p>
<hr />
<div>{{i18n|Backup_Programs}}<br />
<br />
== Введение ==<br />
<br />
Эта статья содержит информацию о различных программах, предназначенных для резервного архивирования данных. Хорошая практика - использовать регулярные бекапы важной информации, особенно конфигурационных файлов (<tt>/etc/*</tt>) и локальной базы данных pacman'а (обычно <tt>/var/lib/pacman/local/*</tt>).<br />
<br />
Несколько слов для окончаня введения: перед тем, как начать пробовать эти программы, подумайте о том, что именно вам нужно; например, решите следущие вопросы:<br />
* Какой носитель данных у меня есть для хранения бекапов?<br />
** cd / dvd<br />
** удаленный сервер (По какому доступу? Ssh? Могу ли я устанавливать какие-нибудь программы на нем (необходимые, например, для решений, основанных на rsync)?)<br />
** внежний жесткий диск<br />
* Как часто я собираюсь делать бекап?<br />
** ежедневно?<br />
** еженедельно?<br />
** еще реже?<br />
* Какие преимущества я ожидаю от выбранного способа архивирования данных?<br />
** сжатие? (по каким алгоритмам?)<br />
** кодирование? (gpg или что-то более простое?)<br />
* Самое главное: как я планирую восстанавливать бекапы когда это понадобится?<br />
<br />
Ладно, с этим разобрались, давайте посмотрим варианты!<br />
<br />
== Нарастающие бекапы (Incremental backups) ==<br />
<br />
Основная особенность этого способа резервного копирования состоит в том, что в начале сохраняется полная копия(зеркало) данных, которые вы хотите резервировать. А далее сохраняется только то, чтобы было изменено, так называемые различия('diffs'). <br />
Если вы хотите часто делать бекапы, это - лучший вариант. Обычно файлы резервных копий не сжимаются и не шифруются, по этому всегда можно быстро получить рабочую копию данных. Но такой подход затрудняет записи архива на CD / DVD ..<br />
<br />
===== Интерфейс командной строки(CLI) =====<br />
*[[rsync]] (в репозиторие extra)<br />
**Rsync почти всегда создает зеркало исходных данных.<br />
**Impossible to restore a backup before the most recent backup<br />
**Входит в стнадартный набор пакетов всех дистрибутивов Linux<br />
**Может работать через SSH (порт 22) или родной протокол rsync (порт 873)<br />
**Доступна версия под Win32<br />
*[http://www.nongnu.org/rdiff-backup/ rdiff-backup] (в репозиторие community)<br />
**Stores most recent backup as regular files<br />
**To revert to older versions, you apply the diff files to recreate the older versions<br />
**It is granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change<br />
**Required python and librsync<br />
**Доступна версия под Win32<br />
*[http://www.rsnapshot.org rsnapshot] (в репозиторие community) <br />
**Does not store diffs, instead it copies entire files if they have changed<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**It is differential in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
**Destination filesystem must support hard links<br />
**Requires perl<br />
**Доступна версия под Win32<br />
*[http://safekeep.sourceforge.net/ SafeKeep] (in AUR)<br />
**Enhancement to rdiff-backup<br />
**Integrates with Linux LVM and databases to create consistent backups<br />
**Bandwidth throttling<br />
* [http://www.scottlu.com/Content/Link-Backup.html Link-Backup] ([http://aur.archlinux.org/packages.php?ID=16929 AUR] may be patched with additional features) is similar to rsync based scripts, but does not use rsync<br />
** Creates hard links between a series of backed-up trees (snapshots)<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer<br />
** dstdir/.catalog is a catalog of all unique file instances; backup trees hard-link to the catalog<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script<br />
** It copies itself to the server; it does not need to be installed on the server<br />
** Requires SSH for remote backups<br />
** It resumes stopped backups; it can even be told to run for n minutes<br />
<br />
===== Графи́ческий интерфе́йс по́льзователя(GUI) =====<br />
*[http://backintime.le-web.org/ Back In Time] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Inspired by FlyBack and TimeVault<br />
**Really is just a front-end to rsync, diff, cp<br />
**A new snapshot is created only if something changed since the last snapshot<br />
*[http://www.flyback-project.org/ FlyBack] (in AUR)<br />
**A clone of Apple's Mac OS X Time Machine software<br />
*[http://areca.sourceforge.net/ Areca Backup] (in AUR)<br />
**Написана на Java<br />
**Primarily archive-based (ZIP), but will do file-based backup as well<br />
**Claims delta backup supported (stores only changes)<br />
*[https://wiki.ubuntu.com/TimeVault TimeVault] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Imitates Windows Volume Shadow Copy feature in that it integrates with Nautilus to provide a "Previous Versions" tab in the Properties dialog.<br />
*[http://luckybackup.sourceforge.net/index.html Luckybackup] (in [http://aur.archlinux.org/packages.php?ID=23121 AUR])<br />
**Luckybackup it's an easy program to backup and sync your files.<br />
**Написана на C++ с использоваинем библиотеки Qt<br />
**It has Sync,Backup (with include and exclude options),Restore operations,Remote connection backup,Scheduled backups,Command line mode and more abilities.<br />
<br />
=== Не основаные на rsync ===<br />
<br />
They tend to create (big) archive files (like tar.bz2), and (of course) keep track of what's been archived. Now creating tar.bz2 or tar.gz archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you don't need to have the backup program around.<br />
<br />
* [[backup-manager|backup-manager]] (in AUR); [http://www.backup-manager.org/ homepage] Backup Manager is a command line backup tool for GNU/Linux, designed to help you make daily archives of your file system. Written in bash and perl, it can make archives in lots of open formats (tar, gzip, bzip2, lzma, dar, zip) and provides lots of interesting features (such as network exports or CD/DVD automated-burning). The program is designed to be as easy to use as possible and is popular with desktop users and sysadmins. The whole backup process is defined in one full-documented configuration file which needs no more than 5 minutes to tune for your needs. It just works. Archives are kept for a given number of days and the upload system can use ftp or scp to transfer the generated archives to a list of remote hosts. Gettext is used for internationalization.<br />
** 1 configuration file, 5 minutes setup<br />
** Manually invoke backup process or run daily unattended via CRON<br />
** Backup files, MySQL databases and Subversion repositories<br />
** Specify multiple targets to backup at once (/etc, /home, etc…)<br />
** Ability to exclude files from backup<br />
** Automatically purge old backups<br />
** Full backup only or Full + Incremental backup<br />
** Backup to an attached disk, LAN or Internet<br />
** Burns backup to CD/DVD with MD5 checksum verification<br />
** Archives in lots of open formats: tar, gzip, bzip2, lzma, dar, zip<br />
** Slice archives to 2 GB if using dar archives format<br />
** Backup over SSH<br />
** Encrypts archives<br />
** Offsite remote upload of archives via FTP, SSH, RSYNC or Amazon S3<br />
** Can run with different configuration files concurrently<br />
** Easy external hooks<br />
**Simply uncompressed the open format backup archives with any command line or GUI tool<br />
<br />
* [[Backup with arch-backup|arch-backup]] (в репозиторие community); [http://code.google.com/p/archlinux-stuff/ website]); trivial backup scripts with simple configuration:<br />
** compression method can be configured<br />
** possible to specify more directories to backup<br />
<br />
* [[Backup with hdup|hdup]] (в репозиторие extra; [http://miek.nl/projects/hdup2/ website]; it's no longer developed, the author develops rdup now (below); but it's still a decent one):<br />
** creates tar.gz or tar.bz2 archives<br />
** supports gpg encryption<br />
** supports pushing over ssh<br />
** possible to specify more directories to backup<br />
<br />
* [http://miek.nl/projects/rdup rdup] (in [http://aur.archlinux.org/packages.php?ID=3728 AUR]) successor to hdup: the program *just determines* which files have changed since the last backup. It's completely up to you what do you want to do with that list. Some helper scripts are supplied, and with them it supports:<br />
** creating tar.gz archives '''or''' rsync-type copy<br />
** encryption (gpg and usual strong (eg. blowfish)), also applies for rsync-type copy<br />
** compression (also for rsync-type copy)<br />
<br />
* [http://www.nongnu.org/duplicity/ duplicity] (в репозиторие community) is similar to hdup, supports tarring and encrypting. But:<br />
** the files backed up are "randomly" distributed between encrypted tar archives, which makes it harder to recover a particular file<br />
** you can backup just one directory at a time (while with hdup you can specify as many as you want in one backup profile)<br />
<br />
* [http://dar.linux.free.fr/ dar] (в репозиторие community): <br />
** it uses its own format for archives (so you need to have it around when you want to restore)<br />
** supports splitting backups into more files by size<br />
** makefile-type config files, some custom scripts are available along with it<br />
** supports basic encryption (not gpg; but also strong, but you need to supply a password every time)<br />
** some gui tools for inspecting backups are also available (kdar, in [http://aur.archlinux.org/packages.php?ID=7586 AUR], but current dar needs beta version)<br />
** a script suitable for running from cron is [http://sarab.sourceforge.net/ sarab] (in [http://aur.archlinux.org/packages.php?ID=17044 AUR]): supports pretty much any backup scheme (Towers of Hanoi, Grandfather-Father-Son, etc..)<br />
<br />
* [http://sourceforge.net/projects/backerupper/ backerupper] (in [http://aur.archlinux.org/packages.php?ID=17441 AUR]) Backerupper is a simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** GUI based<br />
** creating tar.gz archives<br />
** possible to define : backup frequency, backup time, Max copies<br />
<br />
* [http://trac.manent-backup.com/ Manent] (in [http://aur.archlinux.org/packages.php?ID=19241 AUR]) is an algorithmically strong backup and archival program. It's Python based and has the following features:<br />
** Efficient backup to anything that looks like a storage<br />
** Works well over a slow and unreliable network<br />
** Offers online access to the contents of the backup<br />
** Backed up storage is completely encrypted<br />
** Several computers can use the same storage for backup, automatically sharing data<br />
** Not reliant on timestamps of the remote system to detect changes<br />
** Cross-platform support for Unicode file names<br />
<br />
=== Cloud backups ===<br />
<br />
* [http://www.getdropbox.com Dropbox] (in [http://aur.archlinux.org/packages.php?ID=19615 AUR] with Gnome support, and also [http://aur.archlinux.org/packages.php?ID=23363 AUR] without Gnome dependencies). <br />
** A daemon monitors a specified directory, and uploads incremental changes to Dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
<br />
* [http://www.jungledisk.com/ Jungle Disk] (in [http://aur.archlinux.org/packages.php?ID=15015 AUR])<br />
** Automatic backups to Amazon's servers.<br />
** Not free, but very low prices.<br />
<br />
== Not incremental backups ==<br />
* [http://k7z.sourceforge.net/ Q7Z] (in [http://aur.archlinux.org/packages.php?ID=12822 AUR]) is a P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar. Use Q7Z if you want to:<br />
** Update existing archives quickly<br />
** Backup multiple folders to a storage location<br />
** Create or extract protected archives<br />
** Lessen effort by using archiving profiles and lists<br />
* "Just copy everything into one big archive, but support writing to cd/dvd"-type: [http://www2.backup-manager.org/ backup-manager] (in [http://aur.archlinux.org/packages.php?ID=4351 AUR])<br />
* [[Partclone]] -- back up and restore only the used blocks of a partition<br />
* filesystem-backup -- simple bash script (was originally a MySQL backup script) that creates a rolling 7 days, rolling 4 weeks and static monthly backups in tar format. Good for servers without a GUI. Available in repo: http://repo.falconn.nl/any/<br />
* [http://clonezilla.org/ Clonezilla]<br />
**Boots from live CD, USB flash drive, or PXE server<br />
**Uses Partimage, ntfsclone, partclone, and dd, <br />
**Compatability with many file systems (ext2, ext3, ext4, reiserfs, xfs, jfs of GNU/Linux, FAT, NTFS, and HFS+)<br />
**Multicasting server to restore to many machines at once<br />
**If file system is supported , only used blocks in harddisk are saved and restored. For unsupported file system, sector-to-sector copy is done<br />
* [http://www.partimage.org/Main_Page Partimage]<br />
*[http://www.fsarchiver.org/Main_Page Fsarchiver] (в репозиторие extra)<br />
**Support for basic file attributes (permissions, owner, ...)<br />
**Support for multiple file-systems per archive<br />
**Support for extended attributes (they are used by SELinux)<br />
**Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems<br />
**Support for [http://www.fsarchiver.org/Cloning-ntfs ntfs filesystems] (ability to create flexible clones of windows partitions)<br />
**Checksumming of everything which is written in the archive (headers, data blocks, whole files)<br />
**Ability to restore an archive which is corrupt (it will just skip the current file)<br />
**Multi-threaded lzo, gzip, bzip2, lzma [[Compression|compression]]: if you have a dual-core / quad-core it will use all the power of your cpu<br />
**Lzma [[Compression|compression]] (slow but very efficient algorithm) to make your archive smaller.<br />
**Support for splitting large archives into several files with a fixed maximum size<br />
**Encryption of the archive using a password. Based on blowfish from libcrypto from openssl.<br />
**Support backup of a mounted root filesystem (-A option)<br />
<br />
<br />
== Versioning systems ==<br />
<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
* [http://www.selenic.com/mercurial/wiki/ mercurial] or [http://git.or.cz/ git] (both in extra repo)<br />
* [http://eigenclass.org/hiki/gibak-backup-system-introduction gibak]: a backup system based on git. it also supports binary diffs (for binaries, e-books, pictures, multimedia files, etc). on the homepage there is a short usage advice. it is meant to backup only the $HOME directory. one could also backup other directories (like /etc) by changing the $HOME variable to point to that directory (though i don't really recommend this). gibak is handy for people who are familiar with git. it uses .gitignore to filter files and one can use the git commands to restore files, browse through logs, diffs, etc. if one needs a gui, it is also possible to use gitk or qgit to browse through commits or do whatever these interfaces support. get it from AUR: http://aur.archlinux.org/packages.php?ID=18318.<br />
== Articles ==<br />
<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
<br />
[[Category:System recovery (English)]]</div>Greenifhttps://wiki.archlinux.org/index.php?title=Synchronization_and_backup_programs_(%D0%A0%D1%83%D1%81%D1%81%D0%BA%D0%B8%D0%B9)&diff=117441Synchronization and backup programs (Русский)2010-09-15T22:35:37Z<p>Greenif: </p>
<hr />
<div>{{i18n|Backup_Programs}}<br />
<br />
== Введение ==<br />
<br />
Эта статья содержит информацию о различных программах, предназначенных для резервного архивирования данных. Хорошая практика - использовать регулярные бекапы важной информации, особенно конфигурационных файлов (<tt>/etc/*</tt>) и локальной базы данных pacman'а (обычно <tt>/var/lib/pacman/local/*</tt>).<br />
<br />
Несколько слов для окончаня введения: перед тем, как начать пробовать эти программы, подумайте о том, что именно вам нужно; например, решите следущие вопросы:<br />
* Какой носитель данных у меня есть для хранения бекапов?<br />
** cd / dvd<br />
** удаленный сервер (По какому доступу? Ssh? Могу ли я устанавливать какие-нибудь программы на нем (необходимые, например, для решений, основанных на rsync)?)<br />
** внежний жесткий диск<br />
* Как часто я собираюсь делать бекап?<br />
** ежедневно?<br />
** еженедельно?<br />
** еще реже?<br />
* Какие преимущества я ожидаю от выбранного способа архивирования данных?<br />
** сжатие? (по каким алгоритмам?)<br />
** кодирование? (gpg или что-то более простое?)<br />
* Самое главное: как я планирую восстанавливать бекапы когда это понадобится?<br />
<br />
Ладно, с этим разобрались, давайте посмотрим варианты!<br />
<br />
== Нарастающие бекапы (Incremental backups) ==<br />
<br />
Особенность этого способа резервного копирования состоит в том, что при этом запоминается, что именно было сохранено при прошлом бекапе и далее сохраняется только то, чтобы было изменено. Если вы хотите часто делать бекапы, это - лучший вариант.<br />
<br />
=== Rsync-type бекапы ===<br />
Основная характеристика этого способа резервного копирования в том, что при этом сохраняется полная копия директории, бекап которой вы хотите сделать, в традиционном стиле "зеркала".<br />
<br />
Certain rsync-type packages also do snapshot backups by storing files which describe the how the contents of files and folders changed from the last backup (the so-called 'diffs'). Hence, they are inherently incremental, but usually they don't have compression/encryption. On the other hand, a working copy of everything is immediately available, no decompression/decryption needed. Finally the way it works makes it hard to burn backups to cd/dvd..<br />
<br />
===== Интерфейс командной строки(CLI) =====<br />
*[[rsync]] (в репозиторие extra)<br />
**Rsync почти всегда создает зеркало источник резервирования<br />
**Impossible to restore a backup before the most recent backup<br />
**Входит в стнадартный набо пакетов всех дистрибутивов Linux<br />
**Может работать через SSH (порт 22) или родной протокол rsync (порт 873)<br />
**Доступна версия под Win32<br />
*[http://www.nongnu.org/rdiff-backup/ rdiff-backup] (в репозиторие community)<br />
**Stores most recent backup as regular files<br />
**To revert to older versions, you apply the diff files to recreate the older versions<br />
**It is granularly incremental (delta backup), it only stores changes to a file; will not create a new copy of a file upon change<br />
**Required python and librsync<br />
**Доступна версия под Win32<br />
*[http://www.rsnapshot.org rsnapshot] (в репозиторие community) <br />
**Does not store diffs, instead it copies entire files if they have changed<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**It is differential in that the size of the backup is only the original backup size plus the size of all files that have changed since the last backup.<br />
**Destination filesystem must support hard links<br />
**Requires perl<br />
**Доступна версия под Win32<br />
*[http://safekeep.sourceforge.net/ SafeKeep] (in AUR)<br />
**Enhancement to rdiff-backup<br />
**Integrates with Linux LVM and databases to create consistent backups<br />
**Bandwidth throttling<br />
* [http://www.scottlu.com/Content/Link-Backup.html Link-Backup] ([http://aur.archlinux.org/packages.php?ID=16929 AUR] may be patched with additional features) is similar to rsync based scripts, but does not use rsync<br />
** Creates hard links between a series of backed-up trees (snapshots)<br />
** Intelligently handles renames, moves, and duplicate files without additional storage or transfer<br />
** dstdir/.catalog is a catalog of all unique file instances; backup trees hard-link to the catalog<br />
** Transfer occurs over standard I/O locally or remotely between a client and server instance of this script<br />
** It copies itself to the server; it does not need to be installed on the server<br />
** Requires SSH for remote backups<br />
** It resumes stopped backups; it can even be told to run for n minutes<br />
<br />
===== Графи́ческий интерфе́йс по́льзователя(GUI) =====<br />
*[http://backintime.le-web.org/ Back In Time] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Inspired by FlyBack and TimeVault<br />
**Really is just a front-end to rsync, diff, cp<br />
**A new snapshot is created only if something changed since the last snapshot<br />
*[http://www.flyback-project.org/ FlyBack] (in AUR)<br />
**A clone of Apple's Mac OS X Time Machine software<br />
*[http://areca.sourceforge.net/ Areca Backup] (in AUR)<br />
**Написана на Java<br />
**Primarily archive-based (ZIP), but will do file-based backup as well<br />
**Claims delta backup supported (stores only changes)<br />
*[https://wiki.ubuntu.com/TimeVault TimeVault] (in AUR)<br />
**Creates hard links between a series of backed-up trees (snapshots)<br />
**Imitates Windows Volume Shadow Copy feature in that it integrates with Nautilus to provide a "Previous Versions" tab in the Properties dialog.<br />
*[http://luckybackup.sourceforge.net/index.html Luckybackup] (in [http://aur.archlinux.org/packages.php?ID=23121 AUR])<br />
**Luckybackup it's an easy program to backup and sync your files.<br />
**Написана на C++ с использоваинем библиотеки Qt<br />
**It has Sync,Backup (with include and exclude options),Restore operations,Remote connection backup,Scheduled backups,Command line mode and more abilities.<br />
<br />
=== Не основаные на rsync ===<br />
<br />
They tend to create (big) archive files (like tar.bz2), and (of course) keep track of what's been archived. Now creating tar.bz2 or tar.gz archives has the advantage that you can extract the backups with just tar/bzip2/gzip, so you don't need to have the backup program around.<br />
<br />
* [[backup-manager|backup-manager]] (in AUR); [http://www.backup-manager.org/ homepage] Backup Manager is a command line backup tool for GNU/Linux, designed to help you make daily archives of your file system. Written in bash and perl, it can make archives in lots of open formats (tar, gzip, bzip2, lzma, dar, zip) and provides lots of interesting features (such as network exports or CD/DVD automated-burning). The program is designed to be as easy to use as possible and is popular with desktop users and sysadmins. The whole backup process is defined in one full-documented configuration file which needs no more than 5 minutes to tune for your needs. It just works. Archives are kept for a given number of days and the upload system can use ftp or scp to transfer the generated archives to a list of remote hosts. Gettext is used for internationalization.<br />
** 1 configuration file, 5 minutes setup<br />
** Manually invoke backup process or run daily unattended via CRON<br />
** Backup files, MySQL databases and Subversion repositories<br />
** Specify multiple targets to backup at once (/etc, /home, etc…)<br />
** Ability to exclude files from backup<br />
** Automatically purge old backups<br />
** Full backup only or Full + Incremental backup<br />
** Backup to an attached disk, LAN or Internet<br />
** Burns backup to CD/DVD with MD5 checksum verification<br />
** Archives in lots of open formats: tar, gzip, bzip2, lzma, dar, zip<br />
** Slice archives to 2 GB if using dar archives format<br />
** Backup over SSH<br />
** Encrypts archives<br />
** Offsite remote upload of archives via FTP, SSH, RSYNC or Amazon S3<br />
** Can run with different configuration files concurrently<br />
** Easy external hooks<br />
**Simply uncompressed the open format backup archives with any command line or GUI tool<br />
<br />
* [[Backup with arch-backup|arch-backup]] (в репозиторие community); [http://code.google.com/p/archlinux-stuff/ website]); trivial backup scripts with simple configuration:<br />
** compression method can be configured<br />
** possible to specify more directories to backup<br />
<br />
* [[Backup with hdup|hdup]] (в репозиторие extra; [http://miek.nl/projects/hdup2/ website]; it's no longer developed, the author develops rdup now (below); but it's still a decent one):<br />
** creates tar.gz or tar.bz2 archives<br />
** supports gpg encryption<br />
** supports pushing over ssh<br />
** possible to specify more directories to backup<br />
<br />
* [http://miek.nl/projects/rdup rdup] (in [http://aur.archlinux.org/packages.php?ID=3728 AUR]) successor to hdup: the program *just determines* which files have changed since the last backup. It's completely up to you what do you want to do with that list. Some helper scripts are supplied, and with them it supports:<br />
** creating tar.gz archives '''or''' rsync-type copy<br />
** encryption (gpg and usual strong (eg. blowfish)), also applies for rsync-type copy<br />
** compression (also for rsync-type copy)<br />
<br />
* [http://www.nongnu.org/duplicity/ duplicity] (в репозиторие community) is similar to hdup, supports tarring and encrypting. But:<br />
** the files backed up are "randomly" distributed between encrypted tar archives, which makes it harder to recover a particular file<br />
** you can backup just one directory at a time (while with hdup you can specify as many as you want in one backup profile)<br />
<br />
* [http://dar.linux.free.fr/ dar] (в репозиторие community): <br />
** it uses its own format for archives (so you need to have it around when you want to restore)<br />
** supports splitting backups into more files by size<br />
** makefile-type config files, some custom scripts are available along with it<br />
** supports basic encryption (not gpg; but also strong, but you need to supply a password every time)<br />
** some gui tools for inspecting backups are also available (kdar, in [http://aur.archlinux.org/packages.php?ID=7586 AUR], but current dar needs beta version)<br />
** a script suitable for running from cron is [http://sarab.sourceforge.net/ sarab] (in [http://aur.archlinux.org/packages.php?ID=17044 AUR]): supports pretty much any backup scheme (Towers of Hanoi, Grandfather-Father-Son, etc..)<br />
<br />
* [http://sourceforge.net/projects/backerupper/ backerupper] (in [http://aur.archlinux.org/packages.php?ID=17441 AUR]) Backerupper is a simple program for backing up selected directories over a local network. Its main intended purpose is backing up a user's personal data.<br />
** GUI based<br />
** creating tar.gz archives<br />
** possible to define : backup frequency, backup time, Max copies<br />
<br />
* [http://trac.manent-backup.com/ Manent] (in [http://aur.archlinux.org/packages.php?ID=19241 AUR]) is an algorithmically strong backup and archival program. It's Python based and has the following features:<br />
** Efficient backup to anything that looks like a storage<br />
** Works well over a slow and unreliable network<br />
** Offers online access to the contents of the backup<br />
** Backed up storage is completely encrypted<br />
** Several computers can use the same storage for backup, automatically sharing data<br />
** Not reliant on timestamps of the remote system to detect changes<br />
** Cross-platform support for Unicode file names<br />
<br />
=== Cloud backups ===<br />
<br />
* [http://www.getdropbox.com Dropbox] (in [http://aur.archlinux.org/packages.php?ID=19615 AUR] with Gnome support, and also [http://aur.archlinux.org/packages.php?ID=23363 AUR] without Gnome dependencies). <br />
** A daemon monitors a specified directory, and uploads incremental changes to Dropbox.com. <br />
** Changes automatically show up on your other computers. <br />
** Includes file sharing and a public directory. <br />
** You can recover deleted files. <br />
** Community written add-ons. <br />
** Free accounts have 2GB storage.<br />
<br />
* [http://www.jungledisk.com/ Jungle Disk] (in [http://aur.archlinux.org/packages.php?ID=15015 AUR])<br />
** Automatic backups to Amazon's servers.<br />
** Not free, but very low prices.<br />
<br />
== Not incremental backups ==<br />
* [http://k7z.sourceforge.net/ Q7Z] (in [http://aur.archlinux.org/packages.php?ID=12822 AUR]) is a P7Zip GUI for Linux, which attempts to simplify data compression and backup. It can create the following archive types: 7z, BZip2, Zip, GZip, Tar. Use Q7Z if you want to:<br />
** Update existing archives quickly<br />
** Backup multiple folders to a storage location<br />
** Create or extract protected archives<br />
** Lessen effort by using archiving profiles and lists<br />
* "Just copy everything into one big archive, but support writing to cd/dvd"-type: [http://www2.backup-manager.org/ backup-manager] (in [http://aur.archlinux.org/packages.php?ID=4351 AUR])<br />
* [[Partclone]] -- back up and restore only the used blocks of a partition<br />
* filesystem-backup -- simple bash script (was originally a MySQL backup script) that creates a rolling 7 days, rolling 4 weeks and static monthly backups in tar format. Good for servers without a GUI. Available in repo: http://repo.falconn.nl/any/<br />
* [http://clonezilla.org/ Clonezilla]<br />
**Boots from live CD, USB flash drive, or PXE server<br />
**Uses Partimage, ntfsclone, partclone, and dd, <br />
**Compatability with many file systems (ext2, ext3, ext4, reiserfs, xfs, jfs of GNU/Linux, FAT, NTFS, and HFS+)<br />
**Multicasting server to restore to many machines at once<br />
**If file system is supported , only used blocks in harddisk are saved and restored. For unsupported file system, sector-to-sector copy is done<br />
* [http://www.partimage.org/Main_Page Partimage]<br />
*[http://www.fsarchiver.org/Main_Page Fsarchiver] (в репозиторие extra)<br />
**Support for basic file attributes (permissions, owner, ...)<br />
**Support for multiple file-systems per archive<br />
**Support for extended attributes (they are used by SELinux)<br />
**Support the basic file-system attributes (label, uuid, block-size) for all linux file-systems<br />
**Support for [http://www.fsarchiver.org/Cloning-ntfs ntfs filesystems] (ability to create flexible clones of windows partitions)<br />
**Checksumming of everything which is written in the archive (headers, data blocks, whole files)<br />
**Ability to restore an archive which is corrupt (it will just skip the current file)<br />
**Multi-threaded lzo, gzip, bzip2, lzma [[Compression|compression]]: if you have a dual-core / quad-core it will use all the power of your cpu<br />
**Lzma [[Compression|compression]] (slow but very efficient algorithm) to make your archive smaller.<br />
**Support for splitting large archives into several files with a fixed maximum size<br />
**Encryption of the archive using a password. Based on blowfish from libcrypto from openssl.<br />
**Support backup of a mounted root filesystem (-A option)<br />
<br />
<br />
== Versioning systems ==<br />
<br />
These are traditionally used for keeping track of software development; but if you want to have a simple way to manage your config files in one directory, it might be a good solution.<br />
<br />
* [http://www.selenic.com/mercurial/wiki/ mercurial] or [http://git.or.cz/ git] (both in extra repo)<br />
* [http://eigenclass.org/hiki/gibak-backup-system-introduction gibak]: a backup system based on git. it also supports binary diffs (for binaries, e-books, pictures, multimedia files, etc). on the homepage there is a short usage advice. it is meant to backup only the $HOME directory. one could also backup other directories (like /etc) by changing the $HOME variable to point to that directory (though i don't really recommend this). gibak is handy for people who are familiar with git. it uses .gitignore to filter files and one can use the git commands to restore files, browse through logs, diffs, etc. if one needs a gui, it is also possible to use gitk or qgit to browse through commits or do whatever these interfaces support. get it from AUR: http://aur.archlinux.org/packages.php?ID=18318.<br />
== Articles ==<br />
<br />
* [http://www.halfgaar.net/backing-up-unix Backing up Linux and other Unix(-like) systems]<br />
<br />
[[Category:System recovery (English)]]</div>Greenif