UbuntuBootupHowto

Differences between revisions 1 and 2
Revision 1 as of 2005-05-28 20:36:20
Size: 5988
Editor: adsl-213-190-44-43
Comment: imported from the old wiki
Revision 2 as of 2005-06-03 20:48:07
Size: 5989
Editor: adsl-213-190-44-43
Comment: imported from the old wiki
Deletions are marked like this. Additions are marked like this.
Line 162: Line 162:
. Also worth trying Ubuntu Bootup Manager: http://www.ubuntuguide.org/#ubm . Also worth trying Boot-Up Manager: http://www.marzocca.net/linux/bum.html

UbuntuBootupHowto

    We need an explanation of the bootup-process here, This will become a doc then not a howto

Init scripts

http://www.ubuntulinux.org/wiki/IconBoot.png

Init scripts are the scripts located in /etc/init.d. These scripts are part of the bootup sequence of Ubuntu. During boot, they are not called directly, but through a structure of symbolic links which manage the services which are to be started in a particular runlevel. The scripts which are symlinked from /etc/rcS.d are executed first. Then the scripts in /etc/rcN.d/ are executed, with N being the chosen runlevel (default 2).

The LSB specifies some scripts that are used for displaying the output of the initscripts. To change how the init script's startup is displayed look in to /lib/lsb/init-functions

Deactivating init-scripts

To deactivate a script (meaning that it will not be executed at bootup), remove the corresponding symlink from /etc/rc?.d. Do not use the update-rc.d command for this purpose! It is only used in package installation scripts, and not designed for this kind of runlevel management.

Some people on the mailinglist complained on boot-delays because of the NTP-Server sync. To remove this issue the following command:

    sudo rm /etc/rcS.d/S51ntpdate
  • Problem:
    • To restore the links with the right S?? or K?? values you have to look up those values on another system or take a look at the deb-Package install scripts ...

2. Method two: Use chmod to deactivate a service

A more straightforward way is to make the init script non-executable. You do that with the *chmod* command.

    sudo chmod -x /etc/init.d/myscript

After this the service will no longer be able to run.

Reactivate the service with:

    sudo chmod +x /etc/init.d/myscript
  • Problem
    • Now you'll get an error message at boot time saying that init can't execute /etc/init.d/myscript.

  • Solution
    • To avoid this error msgs you have to modify the /etc/init.d/rc and the /etc/init.d/ scripts a bit. To do this simply download and apply the following diffs.

    cd /tmp
    wget http://www.ubuntulinux.org/wiki/rc.diff
    wget http://www.ubuntulinux.org/wiki/rcS.diff

    cd /etc/init.d
    sudo patch -p3 < /tmp/rc.diff
    sudo patch -p3 < /tmp/rcS.diff

3. Method three: Use sysvconfig to deactivate a service

The SysvconfigHowTo explains the installation and use of the sysvconfig utility.

Installing custom init-scripts

To install your own script, copy it to /etc/init.d, and make it executable.

    sudo cp myscript /etc/init.d
    sudo chmod +x /etc/init.d/myscript

To make the script run at startup:

    sudo update-rc.d myscript start 51 S .

(Do not forget the dot: . )

For more information on the usage of update-rc.d

    man update-rc.d

http://www.ubuntulinux.org/wiki/IconWarning3.png

List of init scripts

see InitScriptList

From EduardoSilva Sun Dec 5 19:28:02 +0000 2004 From: Eduardo Silva Date: Sun, 05 Dec 2004 19:28:02 +0000 Subject: Instead of removing the rc*.d links, move them Message-ID: <20041205192802+0000@https://www.ubuntulinux.org>

Instead of removing, I create a directory in my home dir, where I placed all the links I removed from the /etc/rc*.d

From GyorgyNemeth Sun Dec 26 13:39:38 +0000 2004 From: Gyorgy Nemeth Date: Sun, 26 Dec 2004 13:39:38 +0000 Subject: Instead of removing, renaming Message-ID: <20041226133938+0000@https://www.ubuntulinux.org>

If I want to disable initscript temporarily, I simply rename it from Sxxname to sxxname (without capital) It doesn't start, and the starting order information remains

From FabioMarzocca Sun Apr 17 16:32:45 +0100 2005 From: Fabio Marzocca Date: Sun, 17 Apr 2005 16:32:45 +0100 Subject: Message-ID: <20050417163245+0100@https://www.ubuntulinux.org>

Why don't simply use rcconf?? (apt-get install rcconf)

From Chia Thu Apr 21 03:41:09 +0100 2005 From: Chia Date: Thu, 21 Apr 2005 03:41:09 +0100 Subject: Message-ID: <20050421034109+0100@www.ubuntulinux.org>

Try sysv-rc-conf (text based) or ksysv (KDE based). sudo apt-get install sysv-rc-conf

Try sysvconfig as well - it's also quite handy.

From JoostRingoot Fri May 6 10:33:57 +0100 2005 From: Joost Ringoot Date: Fri, 06 May 2005 10:33:57 +0100 Subject: runlevel with networking and without graphical interface? Message-ID: <20050506103357+0100@www.ubuntulinux.org>

I would like to have a runlevel with basic networksupport (and services like ssh and sftp) but without the graphical interface. This is not implemented in /etc/init.d/rcS

When I run: apt-get install rcconf

I get the message that rcconf package could not be found.

apt-get install sysv-rc-conf

tells me that the package is not available although another package points to it

I would like to put this runlevel in the (grub) bootmenu, so that I can choose it at boot and not need to chmod files.

suggestions are welcome.

From Chia Sat May 7 06:46:56 +0100 2005 From: Chia Date: Sat, 07 May 2005 06:46:56 +0100 Subject: Message-ID: <20050507064656+0100@https://www.ubuntulinux.org>

To apt-get sysv-rc-conf, you need to enable universe in /etc/apt/sources.list ,for easy way to do it use synaptic -> settings -> repositories, or read the unofficial ubuntu starter guide at http://www.ubuntuguide.org/ . Also worth trying Boot-Up Manager: http://www.marzocca.net/linux/bum.html

UbuntuBootupHowto (last edited 2008-08-06 16:35:14 by localhost)