Ubuntu Bootup Howto
来源:互联网 发布:幻之伤痛淘宝 编辑:程序博客网 时间:2024/06/07 13:30
- UbuntuBootupHowto
We need an explanation of the bootup-process here, This will become a doc then not a howto
Init scripts
[Note: Ubuntu is transitioning away from the sysv init system. See upstart.]
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).
TheLSB specifies some scripts that are used for displaying the output ofthe initscripts. To change how the init script's startup is displayedlook in to /lib/lsb/init-functions
Deactivating init-scripts
1. Method one: Deleting the rc*.d links
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:
- Torestore the links with the right S?? or K?? values you have to look upthose values on another system or take a look at the deb-Packageinstall 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
List of init scripts
see InitScriptList
links
http://www.wlug.org.nz/update-rc.d%288%29
http://tinyurl.com/3lckz
http://tinyurl.com/5dock
http://www.debian.org/doc/debian-policy/ch-opersys.html#s-sysvinit
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>
IfI want to disable initscript temporarily, I simply rename it fromSxxname to sxxname (without capital) It doesn't start, and the startingorder 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>
Iwould like to have a runlevel with basic networksupport (and serviceslike ssh and sftp) but without the graphical interface. This is notimplemented 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>
Toapt-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 starterguide at http://www.ubuntuguide.org/ . Also worth trying Boot-Up Manager: http://www.marzocca.net/linux/bum.html
CategoryDocumentation CategoryCleanup
原文:https://help.ubuntu.com/community/UbuntuBootupHowto
- Ubuntu Bootup Howto
- HOWTO:Ubuntu下VPN解决方案
- Howto: Ubuntu install From USB
- Howto install matlab on Ubuntu
- HowTo
- (转)[HowTo] Ubuntu, Lighttpd and PHP5
- HOWTO: Install gcc-3.4 in ubuntu 10.04
- HowTo Install Redmine in Ubuntu - Redmine
- Howto: Enable PCNTL in Ubuntu PHP installations
- Howto Install and Configure VTK on Ubuntu
- Howto Install and Configure QtCreator on Ubuntu
- Howto Install and Configure PCL on Ubuntu
- Howto Install and Configure ROS on Ubuntu
- Ubuntu Howto Fix Repository Signature Verification Issues
- Howto install redmine on Ubuntu 16.04
- MTK6225 PhoneBook BootUp
- MTK-Phonebook bootup(1)
- MTK-Phonebook bootup(2)
- 定义VC 消息映射函数小结
- 新版凯立德地图“减肥”定制方法
- VS 2005 C#操作 XML 收藏
- jQuery formValidator表单验证插件开源了!!含API帮助、源码、示例
- 新年第一篇文章(转的是我今年的目标)
- Ubuntu Bootup Howto
- 项目管理过程攻略
- 固定表格宽度
- upstart 和ubuntu启动过程原理介绍
- 双重检查锁定及单例模式
- 用JavaMail API编写可带附件的邮件发送程序
- SQL2005自带的数据库
- Sql Server 2005数据库用户管理
- 成就PHP高手的五个必由之路