Speed Up Boot With Wicd

From Gentoo Linux Wiki

Jump to: navigation, search
Please format this article according to the Style Guidelines and Wikification suggestions, then remove this notice {{Wikify}} from the article.

Reason(s):

  • Explain how this is related to X.Org (if there's a GUI, how can one run it?)
  • Explain how this offers advantages over rc_parallel="YES" in /etc/rc.conf
  • Switch article name to "Setup Wicd", and move the speed-up part to "Tips" section.

The purpose of this article is to show you how you can speed up the booting process using wicd. In the normal setup as shown in the Gentoo Handbook, net.lo and net.eth0 are used to start up the internet. The problem is that net.lo stops everything while it waits for the IP information from the network. Wicd's start up, on the other hand, does not stop the system from continuing and significantly improves start up time, especially with parallel startups.

A second purpose is to add encrypted wireless networking during startup in an intuitive graphical manner. This is especially useful for laptop users.

Contents

[edit] Caution

While wicd starts up quickly, it doesn't connect to the internet any faster. Some startup processes will fail without internet access. In that case, continue to use net.lo. This is for the majority of people who only need internet after the xdm has started and is a way to speed up the entire boot up process.

[edit] What is wicd?

Wicd is a program that connects hardware to networks much like networkmanager. However, its client is not connected to a desktop enviroment like knetworkmanager is. Thus is can startup in the boot process but it has less integration with the desktop. For example, knetworkmanager will automatically put firefox into offline mode when it disconnects. Wicd will not. Wicd is also considered more stable by many laptop users.

More information: http://wicd.sourceforge.net/

[edit] How to install and configure

To install wicd:

emerge -av wicd

To start wicd:

/etc/init.d/wicd start

Setup wicd to automatically start:

rc-update add wicd boot

Do note that wicd will work fine without disabling net.eth0 at boot. However, the speed increase will not be seen without this step. To stop net.eth0 from starting:

rc-update del net.eth0

repeat for each network interface.

If gentoo still tries to start eth0 at boot, add this line to /etc/conf.d/rc:

File: /etc/conf.d/rc
RC_PLUG_SERVICES="!net.*"

Now to setup wicd, go into graphical windows system. There is a way to do this via command line, but it is less intuitive.

Startup wicd-client.

wicd-client

There you will see all avaible wired and wireless connections. The advanced tab allows you to set up the encryption. Once everything is set here, they will be saved for wicd. The nice thing is that wicd will use the settings and connect as soon as wicd starts and doesn't require wicd-client to start.

IMPORTANT: to get wicd to connect to a wireless connection during boot, the "automatically connect to this network which availble" option needs to be enabled. Also note that wicd seperates each router as a different connection but there are options to save settings for any router with the same SSID.

Lastly, the wicd init.d script needs to be updated to include dbus and hald as dependencies otherwise the wireless card may not be found. So go into /etc/init.d/wicd and add them:

File: /etc/init.d/wicd
#!/sbin/runscript
# Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

opts="start stop restart"

WICD_DAEMON=/usr/sbin/wicd
WICD_PIDFILE=/var/run/wicd/wicd.pid

depend() {
        need dbus
        need hald
}

start() {
        ebegin "Starting wicd daemon"
        "${WICD_DAEMON}" >/dev/null 2>&1
        eend $?
}

stop() {
        ebegin "Stopping wicd daemon"
        start-stop-daemon --stop --pidfile "${WICD_PIDFILE}"
        eend $?
}

That should be all you need to elminate the net.eth0 speed bump

[edit] Problems

Sometimes the init process will still start up net.eth0 even with it not being enabled. This happens when another init script calls for net.lo as a dependence. It is probably best not to use wicd as the only network connector in these cases. You can edit the init script and change "need net.lo" to "need wicd", but this risks the process failing on boot up, such as netmount, because wicd will complete before a connection has been made. You have been warned.

As for other issues, please contact me as I have only tried this on three systems and don't know all of the limitations.

The simplest way how to stop net.eth0 from starting is to simply remove or rename it. Most of the "daemons" depend on "use net" whitch starts all the net.* deamons. The best solution would be to rename it, as you don't know when you will need it again.

Personal tools