1. Startup management of source package service# Find the startup script of the service through the installation path of the source package. # That is, get the absolute path of the startup script of the service, # Finally add the startup options. [root@localhost ~]# /usr/local/apache2/bin/apachectl start|stoplrestart|... Notice: When installing services using source packages, the startup scripts for each service are different. How do we know the name of a service's startup script? In the official installation document, you will be clearly told the name of the startup script for the service. Example of starting the service: illustrate: The error message says that the host name Check whether the As shown in the following figure: 2. Self-start management of source package service By configuring the This method is universal and can be used regardless of whether the service is installed with a source package or an RPM package. The key is whether you write the service startup command for the source package or the service startup command for the RPM package in the Therefore, it is recommended to use configuration files to manage services in a universal and unified way in Linux systems. Example: # Configure the /etc/rc.d/rc.local configuration file [root@localhost ~]# vim /etc/rc.d/rc.local # Modify the content of the startup file #!/bin/sh # # This script will be executed *after* all the other init scripts. # You can put your own initialization stuff in here if you don't # want to do the full Sys V style init stuff. touch /var/lock/subsys/local /usr/local/apache2/bin/apachectl start 3. Make the source package service recognized by the service management command Next, we will do an experiment to make the The problem we want to solve is as follows: (1) Allow services installed through source packages to be managed and started by the service command # Make a soft link to the startup script of the service installed through the source package in the /etc/rc.d/init.d/directory [root@localhost ~]# ln -s /usr/local/apache2/bin/apachectl /etc/rc.d/init.d/apachectl Check the contents of Run It can be seen that (2) Allow services installed through source packages to be managed and started automatically by the chkconfig command Following the previous step, you then need to configure the startup scripts of the services installed through the source package that are soft-linked to the # Edit the source package startup script in the /etc/rc.d/init.d/ directory# (Note that this file is a soft link, so the source package startup script is still modified) [root@localhost ~]# vim /etc/rc.d/init.d/apachectl # Add the following content at the beginning #!/bin/sh # Add content-1 # Specify that the httpd script can be managed by the chkconfig command # The format is: chkconfig: run level startup order shutdown order # Here we set apache to be managed by the chkconfig command at levels 3 and 5, the startup order is S86, and the shutdown order is K76 # Note: (Set your own order, do not conflict with the order of existing startup programs in the system) # chkconfig:35 86 76 # # Add content-2 # Description, any content# description: aaabbbccc #The above two sentences must be added to be recognized by the chkconfig command. Then enable [root@localhost ~]# chkconfig --add apachectl No error indicates success. Use the As shown in the following figure: Then you can use the (3) Allow the ntsysv command to manage services installed through source packages The Execute the (4) Summary If you want the source package service to be recognized and managed by In order to make the source package service recognized by the The command format is as follows: [root@localhost ~]# chkconfig [options] [service name] Options: --add: Add the service to the management of the chkconfig command. --del: Delete the service from the management of the chkconfig command. # Example: # Delete the apache service from the chkconfig command management [root@localhost ~]# chkconfig -del httpd After the hint: Just know that services installed with source packages can be handled this way, but it is not recommended. For services installed through source code packages, just start the services using the source code packages. For services installed through RPM packages, just start the services using the RPM packages. This is great. This is the end of this article about service management of source code package installation under Linux. For more relevant Linux source code package installation management content, please search for previous articles on 123WORDPRESS.COM or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future! |
<<: Toolkit: A more powerful front-end framework than Bootstrap
>>: Introduction to the usage of exists and except in SQL Server
Detailed explanation of the usage of DECIMAL in M...
1. Create insert into [table name] (field1, field...
In the past few years, I have been moving back an...
Use blockquote for long citations, q for short ci...
1. Trash or Classic? Web technology updates very ...
Many websites have a navigation bar fixed at the ...
The Linux system is a typical multi-user system. ...
Preface This article was written by a big shot fr...
introduce If you are using an OSS storage service...
Cerebro is an evolution of the Elasticsearch Kopf...
This article uses examples to describe various co...
Table of contents 1. Concepts related to stored p...
background Flex layout achieves alignment and spa...
Copy code The code is as follows: <!DOCTYPE ht...
Record the problem points of MySQL production. Bu...