yam 蕃薯藤
天空部落
  • 網誌
  • 相簿
  • 影音
  • 夯集
  • PK吧!
  • 揪便宜
  • i鬥圖
  • la zorza
  • 買房子
新聞
  • 即時新聞
  • 影音新聞
  • 新聞專輯
  • 政治新聞
  • 財經新聞
  • 娛樂新聞
  • 運動新聞
  • 兩岸新聞
  • 科技新聞
註冊 登入
夯集
隨便逛
  • 正妹
  • 熱門
  • 網誌
  • 旅遊/攝影
  • 愛情/交友
  • 親子/教育
  • 美食/休閒
  • 設計/創作
  • 家族/同好
  • 影視/音樂
  • 社會/人文
  • 時尚/美容
  • 寵物/生活
  • 工作/職場
  • 科技/金融
  • 運動/健康
  • 交通/運輸
  • 相簿
  • COSPLAY
  • 布袋戲迷
  • 電玩漫畫
  • 女生照片
  • 藝術寫真
  • 攝影作品
  • 男生照片
  • 影視娛樂
  • 大眼小布
  • 情侶拍拍
  • 旅遊紀錄
  • 朋友團體
  • 人文藝術
  • more...
推薦這個部落格: 41

我 世界 一條線

淡淡的表達 是 一種哲學 也是一種美........

生活雜記 |時光機 |好友 |來這裡TalkTalk吧!
30元珍奶從此賠錢賣 | 主頁 | Ubuntu無線網路設定
September 10, 2008
Choosing different run level in Ubuntu以文找文
alvinkw 在天空部落發表於14:52:13 | Ubuntu
 
實在是找不到 /etc/inittab 呢 
翻了這本鳥哥私房菜半天    還是對不太起來  
原來Ubuntu自6.10之後就換了"upstart"的方式了   以前的init好就就被代換
以下是找到的資訊

PS 什麼是upstart   說實在我也搞不太懂    待解
 ====
how to change default runlevel in 7.04?

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.

***Ubuntu uses only two runlevels for startup rc1.d and rc2.d.

接著告訴大家怎麼在commandline中換runlevel 
http://bbs.nsysu.edu.tw/txtVersion/boards/linux/M.1192639446.D.html
ubuntu目前採用upstart而非傳統的sysinit管理方式
各種設定檔案放在/etc/event.d底下
其中的rc-default檔案內容如下

=========================
#
# This task guesses what the "default runlevel" should be and starts the
# appropriate script.

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
============================

仔細觀察可以發現裡面會先檢查/etc/inittab中有沒有
id:5:initdefault:
這行文字

如果沒有的話,則預設啟動為runlevel 2

如果想要修改預設的runlevel,可以有以下方法

1.增加/etc/inittab並寫入
id:5:initdefault:

2.將/etc/event.d/rc-default裡面最後的
telinit 2
都改成
telinit *

由於ubuntu的其他runlevel有什麼功能並不是十分清楚
個人查看rc3.d到rc5.d其中的內容幾乎都是相同
跟rc2.d的內容僅有差在S99stop-readahead以及S10powernowd.early
如果只是不想要圖形介面的話,可以自行將rc2.d的資料夾內容中的
S13gdm改名為K13gdm或_S13gdm即可

如果還是想要執行圖形介面的話
執行
#/etc/init.d/gdm
即可

以上方法個人沒有實際測試過,僅有根據手上的7.04 LiveCD及以下網誌推論
http://www.wretch.cc/blog/kenshinn&article_id=2536325
http://ku777.blogspot.com/
http://blog.mypapit.net/2007/03/where-can-i-find-inittab-in-ubuntu-edgy-eft-or-feisty-fawn.html


sudo init 0 進入runlevel 0 等於關機
sudo init 6 進入runlevel 6 重新開機
在每一個/etc/rcX.d/ X=0~6
S開頭的是開機會執行,後面數字為順序
K開頭的是依數字大小關閉程式 通常k開頭的只會在rc0.d or rc6.d
如果有k與s開頭 就會先把k開頭跑完在跑s開頭
留言 (1) | 引用 (0) | 人氣 () | 轉寄 | 檢舉
| 主頁 | 此分類下一篇:Ubuntu無線網路設定
引用 (你可以針對此文寫一篇屬於自己的blog/想法,並給作者一個通告)
引用
留言 (1筆)
1.
此篇為私密留言
lin 於 Nov 25, 2010 留言 |

發表你的留言 (字數限制 最多 2000 個中文字)
注意! 此篇留言為私密留言
Name:



是 否
內容:
檢視行動版網頁  |  檢視正常版網頁
系統公告
I SAY
個人圖檔
ID:alvinkw
暱稱:
生日:1980/11/4
地區:臺北縣
  • 好友 |
    • 好友功能
    • 觀看好友列表
    • 觀看人緣列表
  • 人氣 |
  • 簡介 

熱情贊助
人氣指數
當日人次:
累積人次:
alvinkw的最新力作
  • 2011新北市泰山獅王...
  • 2011新北市泰山獅王...
  • 天行者X9行車紀錄器+...
  • 風之舞-2011新北市...
  • 木乃伊傳奇─埃及古文明特展
yam今日我最殺
文章分類
  • 作業系統 (1)
    • Ubuntu (3)
  • 程式語言 (1)
    • C++ (4)
  • 電影大進擊 (29)
  • 會心一笑 (10)
  • 人氣偶像劇 (43)
  • 鏘鏘鐺鐺半瓶水 (6)
  • DV一定要會 (11)
  • 羽球高手 (1)
  • 醒思小品 (29)
  • 健康小醫師 (6)
  • 情非得已之工作之道 (8)
  • 世界奇觀 (4)
  • 馭錢術 (5)
  • 台灣趴趴走 (23)
  • 亂寫一通 (48)
  • 好康報報 (20)
  • 歡喜拍賣 (11)
  • 密技 (3)
  • 未分類 (1)
人物誌大賞
  • 謝忻
  • 意涵沒涵意
  • 小珊
心動小品
  • 黃俊郎
  • 言語失焦
  • 幾米, 小蝴蝶的飛行空間
愛台彎
  • 台灣生態筆記
  • 馬告國家森林
紅毯的那一端
  • 幸福ㄉ日子
  • 松樹
alvinkw的有話大聲說
  • t54wyh5t4rw:
    私密留言
  • jack:
    私密留言
  • 小寶的主人:
    私密留言
  • 小寶的主人:
    私密留言
  • lin:
    私密留言
行事曆
Feb 2012
S M T W T F S
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29
好時光貼曆
大推薦~讚
Who推薦Me
誰來敲門?
每月文章彙集
  • Dec 2011(3)
  • Nov 2011(2)
  • Oct 2011(3)
  • Sep 2011(1)
  • Jul 2011(4)
  • Jun 2011(3)
  • May 2011(4)
  • Apr 2011(10)
  • Mar 2011(7)
  • Feb 2011(11)
  • Jan 2011(7)
  • Dec 2010(9)
  • Nov 2010(4)
  • Oct 2010(3)
  • Sep 2010(1)
  • Aug 2010(8)
  • Jul 2010(5)
  • Jun 2010(6)
  • May 2010(11)
  • Apr 2010(7)
  • Mar 2010(7)
  • Feb 2010(1)
  • Jan 2010(6)
  • Dec 2008(2)
  • Nov 2008(4)
  • Sep 2008(10)
  • Aug 2008(4)
  • Jun 2008(8)
  • Apr 2008(2)
  • Mar 2008(1)
  • Feb 2008(5)
  • Jan 2008(1)
  • Dec 2007(8)
  • Nov 2007(11)
  • Oct 2007(6)
  • Sep 2007(7)
  • Aug 2007(4)
  • Jul 2007(8)
  • Jun 2007(5)
  • May 2007(1)
  • Apr 2007(2)
  • Mar 2007(2)
  • Feb 2007(1)
  • Jan 2007(5)
  • Dec 2006(1)
  • Nov 2006(10)
  • Oct 2006(33)
  • Sep 2006(8)
  • Aug 2006(3)
  • Jun 2006(8)
  • May 2006(1)
其它資訊
本部落所刊登之內容,皆由作者個人所提供,不代表 yam 天空部落 本身立場。
POWERED BY
POWERED BY 天空部落
會員登入│免費註冊