Chinaunix首页 | 论坛 | 博客
  • 博客访问: 118195
  • 博文数量: 25
  • 博客积分: 605
  • 博客等级: 中士
  • 技术积分: 245
  • 用 户 组: 普通用户
  • 注册时间: 2012-05-02 16:04
文章分类

全部博文(25)

文章存档

2013年(1)

2012年(24)

我的朋友

分类: LINUX

2012-05-05 22:11:21

Ubuntu中没有inittab文件|Ubuntu inittab missing

Ubuntu使用upstart替换了inittab。 具体的看一下/etc/event.d/目录就可以。
如何使Ubuntu默认不使用图形界面呢?

$cat /etc/event.d/rc-default
start on stopped rcS

 

script
        runlevel --reboot || true

        if grep -q -w -- "-s\|single\|S" /proc/cmdline; then
            telinit S
        elif [ -r /etc/inittab ]; then
            RL="$(sed -n -e "/^id:[0-9]*:initdefault:/{s/^id://;s/:.*//;p}" /etc/inittab || true)"
            if [ -n "$RL" ]; then
                telinit $RL
            else
                telinit 2
            fi
        else
            telinit 2
        fi
end script

解决办法很简单:
$ sudo mv /etc/rc3.d/S30gdm /etc/rc3.d/K30gdm
然后把最后一行的telinit 2改为telinit 3即可(或者编辑一个/etc/inittab文件,内容为id:3:initdefault:)。Ubuntu中此命令从文本模式启动。

另外,Ubuntu的一个特殊的地方是,它默认的启动级别是2,使用runlevel命令查看,得到N 2。一般系统,如R.H.,启动的级别是5。但仔细查看Ubuntu中的/etc/rc2.d和/etc/rc5.d,它们所包含的内容基本一致。

# runlevel.

If you create your own /etc/inittab file, Ubuntu will honour it.

To change your runlevels the Ubuntu way look in /etc/init.d/ which contains startup scripts. Then look in /etc/rc#.d/ which contains symlinks to scripts in /etc/init.d/. The name of the symlinks determines what will be started/stopped and in what order. Look in the README file in any of the /etc/rc#.d/ directories for details.

The # in the /etc/rc#.d/ is the runlevel number.

To stop GDM from loading in runlevel 2 (Ubuntu default runlevel) rename /etc/rc2.d/S30gdm to /etc/rc2.d/K70gdm

The S tells Ubuntu to start the process, and the K tells Ubuntu to kill it. The number is the order in which it should be started/stopped.

Have a look at the man page for update-rc.d which can be used to create/update/remove the init script symlinks for you.

EDIT: You can also

the Boot-Up Manager (BUM) which is a graphical tool to configure runlevels. It's in the repositories.
阅读(1202) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~