How does Ubuntu Server unify boot-up management (get boot-up list and boot-up status of a service)?

  linux, question
  • System Environment: Ariyun ECS

  • System Version: Ubuntu 14.04.3

  • Question: How to uniformly manage service startup under UbuntuSever

There are several general boot-up methods under Linux (I understand the principle is similar), but it is not very convenient to manage them.

/etc/rc.local
 /etc/rcN.d/script_filenalme # N is the startup level

Therefore, each distribution has its own management tools or scripts

# CentOS & Redhat
 Chkconfig srvice _ name {on | off} # centos version 6.x
 Systemctlenableservice _ name # centos version 7.x and above
 
 # Ubuntu (not checked by Debin) found the following 2 ways
 update-rc.d service_name defaults;
 sysv-rc-conf --level 345 service_name on;

What is puzzling is that both methods seem to manage some services, but they cannot be found in their respective methods, such as:

  1. The default startup service, usingsysv-rc-confNot found:

    SYSV-RC-CONF-LIST | GREP' SSH \ | CRON' # Results only output the service name and do not show the status at each run level
  2. Useupdate-rc.dOpen cron and prompt does not exist

    shell> update-rc.d cron defaults
     
     update-rc.d: warning: /etc/init.d/cron missing LSB information
     update-rc.d: see   < http://wiki.debian.org/LSBInitScripts >
     System start/stop links for /etc/init.d/cron already exist.
  3. The service started by default cannot be found under the current running level.

    Ll/etc/rc $ (runlevel | awk' {print $ nf}'). d/s * | grep 'cron \ | ssh' # content is empty
  4. Usesysv-rc-configCommand to view, there is indeed a similarssh,cronSuch as the default boot start service is not checked

    sysv-rc-config

    clipboard.png

Is there a great god who is familiar with UbuntuServer, give directions, what are the reasons for the above problems, and how to uniformly manage service startup under UbuntuServer?


I understand, it feels a little messy ~, I understand roughly as follows:

Ubuntu has developed a self-starting management mechanism calledUpStartAt the same time, the previousSystem-V initThe mechanism has not been completely abandoned. The coexistence of the two methods has led me to wonder before.

Judgment basis

Distinguishing which service is started in which way can be viewed/etc/init/service_name.conf

(The following contents were directly pasted from the original text and changed)

  1. In/etc/initIf the. conf cannot be found at the bottom, return.sysvinitTube.

  2. executive commandinitctl listIf byupstartThe status of the started service is listed.

On the link, interested in yourself to see it

Reference address:UpStart

initctl