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.
- 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
This is a BUG in Ubuntu 12.04. You can solve it using the following methods:
- root@node2:/root# whereis insserv
- 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 /.
- root@node2:/root# ls -l /usr/lib/insserv/
- total 56
- -rwxr-xr-x 1 root root 56368 Apr 9 19:07 insserv
Then I made a connection.
- root@node2:/root# ln -s /usr/lib/insserv /sbin/insserv
- root@node2:/root# chkconfig drbd on
- /sbin/insserv: Permission denied
From the above we can see that a permission is not allowed, and it is very depressing.
- 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
We can see from the above that it is depressing to have permissions,Finally, we found that/usr/lib/insserv is a directory.
- root@node2:~# cd /usr/lib/insserv/
- root@node2:/usr/lib/insserv# pwd
- /usr/lib/insserv
- root@node2:/usr/lib/insserv# ls
- insserv
Then we can solve the problem.
- 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'
I reported a bunch of other errors. Check whether the service is 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. Now the service is ready. Ubuntu still has bugs. I used to play RedHat and didn't find similar problems.