2007年11月26日 星期一

修改 Ubuntu runlevel 設定

今天想要把原本 run XWindow 的 Ubuntu 改為 run console 就好了,這樣系統資源的耗費可以省一點。

結果發現,在 Ubuntu 中竟然沒有 /etc/inittab 這個檔案........(忘記從哪一版開始沒有,不過我用 6.10 就已經沒有了!)

因此 google 的一下修改方式,找到以下這邊討論串:

由於解說蠻簡單的,也就不翻譯了,直接節錄修改方式:
1./etc/inittab.
You're right. It's gone. It left as of Edgy Eft, as Ubuntu now manages start-up services with "upstart."
The file does exist in pre-Edgy Ubuntu's, and other flavors of Linux, so you were not crazy to look there .

2. default runlevel in Ubuntu

In redhat/suse, the default run level is 5. I came from RH, and like you, expected the same in Ubuntu. After the "upstart" transition, the notion of runlevels is supposedly gone, but if forced to choose, the default run level is actually 2 in Ubuntu, not 5.

2. You don't want GNOME to start at boot, how?

So yes, in other flavors of Linux, you'd probably just change run levels, because on run level would have X, and another wouldn't. But in Ubuntu, *all* run levels start GNOME, so here's an easier way:

In /etc/rc2.d, you will see a file S13gdm. This starts the GNOME system.
Simply change that file to K13gdm.

# sudo mv S13gdm K13gdm

(It's possible the number between the "S" and the "gdm" will be slightly different than 13. That's OK.)

This leaves the package installed, but just not started at boot.

To start X later, run:

# sudo /etc/init.d/gdm start.
看了以上的修改方式,就是不讓 GDM 啟動就對了!

不過應該還有更好的修改方式,之後有看到再說吧!!

1 則留言: