Home PC Games Linux Windows Database Network Programming Server Mobile  
           
  Home \ Linux \ Chkconfig command Detailed service is added and shut down the system in two ways to start service under Linux     - KVM virtualization nested configuration (Server)

- HTTPS and SSH and use the difference between the way: Git User's Manual (Linux)

- Linux system find command Detailed (Linux)

- CentOS 6.6 running level (Linux)

- Ubuntu 14.04 build Hadoop 2.5.1 standalone and pseudo-distributed environment (32-bit) (Server)

- Merge Sort (Programming)

- JavaScript prototype and prototype chain and project combat (Programming)

- PULL operation mechanism parsing XML Comments (Programming)

- Java in several ways of using MongoDB (Programming)

- MySQL database master never solve the synchronization method (Database)

- Strategy Games Ubuntu installation of Wesnoth 1.12.1 (Linux)

- Java implementation heap sort (large root heap) (Programming)

- Linux using DenyHosts prevents ssh cracks (Linux)

- Schema snapshot rollback (Database)

- Linux beginners should know 12 commands (Linux)

- Oracle first Automated Installation Packages (Database)

- Docker study notes (Server)

- Nginx request processing (Server)

- how to quickly find a file on Linux system (Linux)

- Use netcat [nc] command on Linux and Unix port scan (Server)

 
         
  Chkconfig command Detailed service is added and shut down the system in two ways to start service under Linux
     
  Add Date : 2017-04-13      
         
         
         
  Chkconfig command is mainly used to update run-level information (start or stop) and query system services. Remember chkconfig not immediately automatically disable or activate a service, it simply changes the symbolic link.

First, chkconfig usage syntax
1, chkconfig [--add] [- del] [- list] [system service] or chkconfig [--level < levels Level code>] [System Services] [on / off / reset]

2, the parameter usage:
  --add increase in the specified system services to chkconfig command to manage it, and at the same time increasing the relevant data in the system startup file description.
  --del delete the specified system service is no longer managed by the chkconfig command and delete related data in the system startup file description.
  --level < level code> Specify read System Services To turn on or off the completion of execution in which a hierarchy.
      Level 0 means: showing off
      Level 1 means: single-user mode
      Level 2 indicates: no network connection multi-user command line mode
      Level 3 means: multi-user command line mode with networking
      Level 4 indicates: System Reserved
      Level 5 indicates: multi-user mode with GUI
      Level 6, said: Restart
 3. It should be noted, level option to specify the run level you want to view and not necessarily the current run level. For each run level, only one startup script or a stop script. When switching run level, init does not restart the service has been launched, it will not have to stop to stop the service again.

4, chkconfig --list [name]: Displays the operating status of all information systems and services run level (on or off). If you specify a name, then display only the specified service status at different operating levels.
5, chkconfig --add name: to add a new service. chkconfig to ensure that each class has a running start (S) or killed (K) entrance. If anything is missing, it will automatically created from the default init scripts.
    chkconfig --del name: delete the service, and the related symbolic link from /etc/rc[0-6].d.
    chkconfig [--level levels] name: set a service running at the specified level is to be started, stopped or reset.

6, run the file level:
Each needed chkconfig management services under the corresponding init.d script plus two more lines or comment lines. The first line tells chkconfig default startup run level and start and stop priority. If a service is not in any default run level start, use - instead of run level. The second line of the service description, you can use \ interbank comment.
For example, random.init contain three lines:
# Chkconfig: 2345 20 80
# Description: Saves and restores system entropy pool for \
# Higher quality random number generation.

Use of examples:
chkconfig --list # List all system services
chkconfig --add httpd # service httpd increase
chkconfig --del httpd # delete httpd service
chkconfig --level 2345 httpd on # httpd set in the case of 2,3,4,5 runlevel is on (open) state
chkconfig --list # lists all system services startup situation
chkconfig --list mysqld # listed mysqld service settings circumstances
chkconfig --level 35 mysqld on # set mysqld in grades 3 and 5 to start running services, - level 35 indicates the operation in grades 3 and 5 perform only, on start showing, off means closed
chkconfig mysqld on # mysqld set in each grade on, "each grade" rating include 2,3,4,5

7, how to add a service: A Case Study in mysqld
(1), service script must be stored in the /etc/init.d/ directory;
(2), chkconfig --add mysqld # added services, increase service chkconfig tool in the list of services, then the service will be given in /etc/rc.d/rcN.d in K / S inlet;
(3), chkconfig --level 35 mysqld on # to modify the default service startup level.

Second, the service startup / shutdown
1, system services: it remains in memory, and has been running and providing services is called a service;

2, while the service is running, then the program is running is called daemons;

3, the startup script for these services are generally placed in: /etc/init.d

4, CentOS service startup scripts in: /etc/rc.d/init.d and accepted this directory /etc/init.d directory is a link file in the /etc/init.d centos

5, / etc / sysconfig service initialization environment variable configuration in this file.

6, the database / var / lib various services generated in this directory, the easiest to use vim found here mysql open you can see, the name of the database you created and the default database generated in the inside!

7, the start / stop / restart services: /etc/init.d/ serverName start / stop / restart / status

8, start / stop / restart services: service serverName start / stop / restart Why can write?

9, service is a script that he can analyze your behind assigned parameters, and then according to your parameters to /etc/init.d go get the proper service to stop start restart
     
         
         
         
  More:      
 
- Linux Mint 17.2 64 bit installation Docker and management software seagull (Linux)
- There are more than one server, there is reason to try cloud operating system (Server)
- Using Python to find a particular file extension directory (Programming)
- RedHat Linux source code package installation process (Linux)
- PostgreSQL Stream Configuration (Database)
- PLSQL often lose resolution process automatically disconnect the connection (Database)
- Install Java, Maven, Tomcat under Linux (Linux)
- Understanding the type in C ++ bitset (Programming)
- Python cause yum upgrade error (Linux)
- How to forcibly change the Linux system password on a regular basis (Linux)
- MySQL innodb_table_stats table does not exist solution (Database)
- Analysis of MySQL Dockerfile 5.6 (Database)
- Oracle View Object Information (Database)
- Oracle 12CIN-memory in table spaces (Database)
- Easily solve the MySQL database connection error too many (Database)
- Spring Data study notes -Helloworld (Programming)
- Ubuntu 12.04 64-bit installation Redmine + Git + ReviewBoard (Linux)
- How to deploy Icinga server (Server)
- Ubuntu 14.04 after the restart the default maximum screen brightness solutions (Linux)
- CentOS minimal network is unavailable resolved (Linux)
     
           
     
  CopyRight 2002-2022 newfreesoft.com, All Rights Reserved.