Common usage of linuxservice commands

Source: Internet
Author: User
A service Command, as its name implies, is a command used to manage services in a Linux operating system. 1. Declaration: this command is not available in all linux releases. Mainly in redhat, fedora, mandriva, and centos. 2. this command is located in the/sbin Directory. use the file command to query the... service Command. as the name suggests, it is the command used to manage services in the Linux operating system. 1. Declaration: this command is not available in all linux releases. Mainly in redhat, fedora, mandriva, and centos. 2. this command is located in the/sbin Directory. you can use the file command to view the command and find it a script command. 3. the analysis script shows that the function of this command is to find the corresponding service in the/etc/init. d Directory and perform operations such as enabling and disabling the command. 4. enable httpd server: service httpd startstart can be changed to restart, stop to stop, and reload to re-load the configuration. 5. disable mysql server: service mysqld stop6. we strongly recommend that you replace the service command with/etc/init. d/mysqld stop (because some linux versions do not support service) Usage: service <option> | -- status-all | [service_name [command | -- full-restart] service oracle startservice oracle stopservice oracle restartservice oracle status example 1 network restart when the host name and IP address are modified and other information, you often need to restart the network to make it take effect. [Root @ node34 root] # service network usage:/etc/init. d/network {start | stop | restart | reload | status} [root @ node34 root] # service network status configuration device: lo eth0 current active device: lo eth0 [root @ node34 root] # service network restart is shutting down the interface eth0: [OK] closing the loopback interface: [OK] setting network parameters: [OK] the loopback interface is displayed: [OK] Pop-Up interface eth0: [OK] Example 2 restart MySQL [root @ node34 root] # service mysqlmysql: unrecognized service [root @ node34 root] # service mysqld usage: /etc/init. d/mysqld {start | stop | status | condrestart | restart} [root @ node34 root] # service mysqld statusmysqld (pid 1638) is running... [root @ node34 root] # service mysqld restart stop MySQL: [OK] start MySQL: [OK] [root @ node34 root] #

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.