The service command, as the name suggests, is a command used to manage services in the Linux operating system.
1. Disclaimer: This command is not available in all linux distributions. Mainly in redhat, fedora, mandriva and centos.
2. This command is located in the /sbin directory. Use the file command to view this command and you will find that it is a script command.
3. The analysis script shows that the function of this command is to search for the corresponding service in the /etc/init.d directory, and perform operations such as opening and closing.
4. Start the httpd server: service httpd start
start can be replaced with restart to indicate restart, stop to close, and reload to reload the configuration.
5. Shut down the mysql server: service mysqld stop
6. It is strongly recommended 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 start
service oracle stop
service oracle restart
service oracle status