解決ubuntu的chkconfig[/sbin/insserv 無法找到路徑問題]

來源:互聯網
上載者:User

解決ubuntu的chkconfig[/sbin/insserv 無法找到路徑問題]
 今天在虛擬機器裡做DRBD實驗,使用chkconfig管理服務的時候,出現了問題。      root@node2:/root# chkconfig --list | grep drbd     drbd                      0:off  1:off  2:off  3:off  4:off  5:off  6:off     root@node2:/root# chkconfig drbd on     /sbin/insserv: No such file or directory  這是Ubuntu 12.04的一個BUG,使用以下方法可以解決      root@node2:/root# whereis insserv     insserv: /etc/insserv /etc/insserv.conf /usr/lib/insserv /usr/share/insserv /usr/share/man/man8/insserv.8.gz  把上面找到的目錄,一個一個的看一遍,發現檔案在/usr/lib/裡面      root@node2:/root# ls -l /usr/lib/insserv/     total 56     -rwxr-xr-x 1 root root 56368 Apr  9 19:07 insserv  然後我就做了個串連過去      root@node2:/root# ln -s /usr/lib/insserv /sbin/insserv     root@node2:/root# chkconfig drbd on     /sbin/insserv: Permission denied  從上面看出,報了一個許可權不允許,很鬱悶      root@node2:/root# ls -l /sbin/insserv    lrwxrwxrwx 1 root root 16 Jun 21 04:27 /sbin/insserv -> /usr/lib/insserv     root@node2:/root# ls -l /usr/lib/insserv     total 56     -rwxr-xr-x 1 root root 56368 Apr  9 19:07 insserv  從上面看出,有許可權的啊,好鬱悶,最後發現 /usr/lib/insserv竟然是一個目錄      root@node2:~# cd /usr/lib/insserv/     root@node2:/usr/lib/insserv# pwd     /usr/lib/insserv     root@node2:/usr/lib/insserv# ls     insserv  然後就好解決了      root@node2:/usr/lib/insserv# rm -rf /sbin/insserv     root@node2:/usr/lib/insserv# ln -s /usr/lib/insserv/insserv /sbin/insserv     root@node2:/usr/lib/insserv# chkconfig drbd on     The script you are attempting to invoke has been converted to an Upstart     job, but lsb-header is not supported for Upstart jobs.     insserv: warning: script 'friendly-recovery' missing LSB tags and overrides     insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery'     insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `friendly-recovery'  報了一堆的其它錯誤,先不管吧,看看服務OK沒      root@node2:/usr/lib/insserv# chkconfig --list | grep drbd     drbd                      0:off  1:off  2:on   3:on   4:on   5:on   6:off     root@node2:/usr/lib/insserv#   OK,現在看到服務已經搞定了。Ubuntu還是有Bug的,呵呵,好像還挺多。以前總是玩RedHat,沒發現類似的問題。

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.