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中此命令从文本模式启动。
# 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 install
the Boot-Up Manager (BUM) which is a graphical tool to configure runlevels. It's in the repositories.