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     - How to make GRub instead of the default Ubuntu software center (Linux)

- Bash common several configuration files (Linux)

- PostgreSQL using the system cache to improve operational efficiency (Database)

- Android custom ViewPager create kaleidoscopic image transition effects (Programming)

- MyCAT log analysis (Database)

- Linux basic introductory tutorial ---- Software Installation under Linux (Linux)

- hadoop 2.7.1 High Availability Setup Deployment (Server)

- The ORA-01113 error is handled with BBED without archiving (Database)

- Struts2 configure a static resource files without Struts processing (regular match) (Programming)

- Shell Programming points to note about the function (Programming)

- MultiWriter: while the ISO image concurrent writes 20 USB Startup Disk (Linux)

- Ubuntu PPA install SMPlayer 14.9 (Linux)

- Bug tracking library after FastJson omitted the decimal point 0 (Programming)

- Android Application Development: Genymotion can not start solving (Linux)

- To use Java arrays implement the order form (Programming)

- Install OpenGL development environment in Fedora and Ubuntu (Linux)

- Oracle 11g new features of the collection of multi-column statistics (Database)

- Linux, MySQL root privilege escalation another method (Linux)

- Copy and paste in Linux terminal and Vim (Linux)

- Hadoop virtualization performance comparison and tuning experience (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 system performance analysis and top command ps.pstree Comments (Linux)
- ORA-01000 Solution (Database)
- Linux server startup and logon security settings (Linux)
- Linux Variable content removal and replacement (Linux)
- Detailed iptables (Linux)
- Linux iptables: basic principles and rules (Linux)
- Modern Objective-C syntax and new features (Programming)
- Build RPM package uses Docker mirror (Linux)
- Hard disk encryption to protect data security (Linux)
- How to Install SeaMonkey 2.25 for Ubuntu (Linux)
- Ubuntu use three methods to install Ruby (Linux)
- Oracle Incident Packaging Service (Database)
- Ubuntu FAQ solutions (Linux)
- Linux remote landing system (Linux)
- To upgrade combat MongoDB database replication sets and split versions (Database)
- Java annotations entry automatically generates SQL statements (Programming)
- Use the DBMS_SCHEDULER package to manage scheduled tasks (Database)
- Selection sort, insertion sort, and Shell sort (Programming)
- Use Tmux and Vim to make IDE (Linux)
- Installation Eduspec university management systems 17 Linux Mint (Server)
     
           
     
  CopyRight 2002-2020 newfreesoft.com, All Rights Reserved.