国产探花免费观看_亚洲丰满少妇自慰呻吟_97日韩有码在线_资源在线日韩欧美_一区二区精品毛片,辰东完美世界有声小说,欢乐颂第一季,yy玄幻小说排行榜完本

首頁(yè) > 系統(tǒng) > Ubuntu > 正文

Ubuntu Update-rc.d命令詳細(xì)介紹

2020-10-18 20:49:04
字體:
供稿:網(wǎng)友

Ubuntu或者Debian系統(tǒng)中update-rc.d命令,是用來更新系統(tǒng)啟動(dòng)項(xiàng)的腳本。這些腳本的鏈接位于/etc/rcN.d/目錄,對(duì)應(yīng)腳本位于/etc/init.d/目錄。在了解update-rc.d命令之前,你需要知道的是有關(guān)Linux系統(tǒng)主要啟動(dòng)步驟,以及Ubuntu中運(yùn)行級(jí)別的知識(shí)。


一、Linux系統(tǒng)主要啟動(dòng)步驟

  讀取 MBR 的信息,啟動(dòng) Boot Manager。

  加載系統(tǒng)內(nèi)核,啟動(dòng) init 進(jìn)程, init 進(jìn)程是 Linux 的根進(jìn)程,所有的系統(tǒng)進(jìn)程都是它的子進(jìn)程。

  init 進(jìn)程讀取 /etc/inittab 文件中的信息,并進(jìn)入預(yù)設(shè)的運(yùn)行級(jí)別。通常情況下 /etc/rcS.d/ 目錄下的啟動(dòng)腳本首先被執(zhí)行,然后是/etc/rcN.d/ 目錄。

  根據(jù) /etc/rcS.d/ 文件夾中對(duì)應(yīng)的腳本啟動(dòng) Xwindow 服務(wù)器 xorg,Xwindow 為 Linux 下的圖形用戶界面系統(tǒng)。

  啟動(dòng)登錄管理器,等待用戶登錄。

二、運(yùn)行級(jí)別

  Ubuntu中的運(yùn)行級(jí)別

  0(關(guān)閉系統(tǒng))
  1(單用戶模式,只允許root用戶對(duì)系統(tǒng)進(jìn)行維護(hù)。)
  2 到 5(多用戶模式,其中3為字符界面,5為圖形界面。)
  6(重啟系統(tǒng))

  切換運(yùn)行級(jí)別

  

復(fù)制代碼
代碼如下:
init [0123456Ss]

  例如:init 0 命令關(guān)機(jī); init 6 命令重新啟動(dòng)

  啟動(dòng)項(xiàng)管理工具

復(fù)制代碼
代碼如下:

  sudo install sysv-rc-conf //或者使用帶gui的工具bum
  sudo sysv-rc-conf


三、update-rc.d命令詳解

  從所有的運(yùn)行級(jí)別中刪除指定啟動(dòng)項(xiàng)

復(fù)制代碼
代碼如下:

  update-rc.d -f remove

  按指定順序、在指定運(yùn)行級(jí)別中啟動(dòng)或關(guān)閉

復(fù)制代碼
代碼如下:

  update-rc.d start|stop

  實(shí)例:update-rc.d apachectl start 20 2 3 4 5 . stop 20 0 1 6 .

  解析:表示在2、3、4、5這五個(gè)運(yùn)行級(jí)別中,由小到大,第20個(gè)開始運(yùn)行apachectl;在 0 1 6這3個(gè)運(yùn)行級(jí)別中,第20個(gè)關(guān)閉apachectl。這是合并起來的寫法,注意它有2個(gè)點(diǎn)號(hào),效果等于下面方法:

復(fù)制代碼
代碼如下:

  update-rc.d apachectl defaults

  A啟動(dòng)后B才能啟動(dòng),B關(guān)閉后A才關(guān)閉

復(fù)制代碼
代碼如下:

  update-rc.d A defaults 80 20
  update-rc.d B defaults 90 10

  啟動(dòng)和關(guān)閉順序?yàn)?0,級(jí)別默認(rèn)

復(fù)制代碼
代碼如下:

  update-rc.d defaults 90</p><p>Insert links using the defaults:
update-rc.d foobar defaults</p><p>Equivalent command using explicit argument sets:
update-rc.d foobar start 20 2 3 4 5 . stop 20 0 1 6 .</p><p>More typical command using explicit argument sets:
update-rc.d foobar start 30 2 3 4 5 . stop 70 0 1 6 .</p><p>Remove all links for a script (assuming foobar has been deleted
already):
update-rc.d foobar remove</p><p>Example of disabling a service:
update-rc.d -f foobar remove
update-rc.d foobar stop 20 2 3 4 5 .</p><p>Example of a command for installing a system initialization-and-shut 主站蜘蛛池模板: 额济纳旗| 梧州市| 阿巴嘎旗| 清水县| 错那县| 伊宁市| 渭南市| 汪清县| 绥化市| 南漳县| 达州市| 新安县| 明光市| 米泉市| 金华市| 巴青县| 赤城县| 岳普湖县| 搜索| 塔河县| 军事| 河西区| 乌兰浩特市| 六枝特区| 鄯善县| 工布江达县| 龙岩市| 翼城县| 甘孜| 大足县| 尉氏县| 缙云县| 剑河县| 霞浦县| 内黄县| 云梦县| 乌拉特前旗| 潼关县| 中方县| 宜昌市| 穆棱市|