Ubuntu12.04 cannot use the chkconfig Management Service

Source: Internet
Author: User
Today, I did a DRBD experiment in a virtual machine and encountered a problem when I used the chkconfig management service. Root @ node2:/root # chkconfig -- list | grepdrbddrbd is doing a DRBD experiment in the virtual machine today. When using chkconfig to manage the service, a problem occurs.
 
 
  1. root@node2:/root# chkconfig --list | grep drbd 
  2. drbd                      0:off  1:off  2:off  3:off  4:off  5:off  6:off 
  3. root@node2:/root# chkconfig drbd on 
  4. /sbin/insserv: No such file or directory 

This is a BUG in Ubuntu 12.04. You can solve it using the following methods:

 
 
  1. root@node2:/root# whereis insserv 
  2. insserv: /etc/insserv /etc/insserv.conf /usr/lib/insserv /usr/share/insserv /usr/share/man/man8/insserv.8.gz 

Read the directories found above one by one and find the files in/usr/lib /.

 
 
  1. root@node2:/root# ls -l /usr/lib/insserv/ 
  2. total 56 
  3. -rwxr-xr-x 1 root root 56368 Apr  9 19:07 insserv 

Then I made a connection.

 
 
  1. root@node2:/root# ln -s /usr/lib/insserv /sbin/insserv 
  2. root@node2:/root# chkconfig drbd on 
  3. /sbin/insserv: Permission denied 

From the above we can see that a permission is not allowed, and it is very depressing.

 
 
  1. root@node2:/root# ls -l /sbin/insserv
  2. lrwxrwxrwx 1 root root 16 Jun 21 04:27 /sbin/insserv -> /usr/lib/insserv 
  3. root@node2:/root# ls -l /usr/lib/insserv 
  4. total 56 
  5. -rwxr-xr-x 1 root root 56368 Apr  9 19:07 insserv 

We can see from the above that it is depressing to have permissions,Finally, we found that/usr/lib/insserv is a directory. 

 
 
  1. root@node2:~# cd /usr/lib/insserv/ 
  2. root@node2:/usr/lib/insserv# pwd 
  3. /usr/lib/insserv 
  4. root@node2:/usr/lib/insserv# ls 
  5. insserv 

Then we can solve the problem.

 
 
  1. root@node2:/usr/lib/insserv# rm -rf /sbin/insserv 
  2. root@node2:/usr/lib/insserv# ln -s /usr/lib/insserv/insserv /sbin/insserv 
  3. root@node2:/usr/lib/insserv# chkconfig drbd on 
  4. The script you are attempting to invoke has been converted to an Upstart 
  5. job, but lsb-header is not supported for Upstart jobs. 
  6. insserv: warning: script 'friendly-recovery' missing LSB tags and overrides 
  7. insserv: Default-Start undefined, assuming empty start runlevel(s) for script `friendly-recovery' 
  8. insserv: Default-Stop  undefined, assuming empty stop  runlevel(s) for script `friendly-recovery' 

I reported a bunch of other errors. Check whether the service is OK.

 
 
  1. root@node2:/usr/lib/insserv# chkconfig --list | grep drbd 
  2. drbd                      0:off  1:off  2:on   3:on   4:on   5:on   6:off 
  3. root@node2:/usr/lib/insserv#  

OK. Now the service is ready. Ubuntu still has bugs. I used to play RedHat and didn't find similar problems.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

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.