Linux software installation - Service Management

Linux software installation - Service Management

Abstract: This paper studied the knowledge about Linux in service management.

What is a Service

It is typically placed in a service running in the background or more points into the process to provide services to a particular user or the system, some system services, while others are independent network services.

For these services, we can activate or deactivate the service by running the main program, can also be managed by chkconfig and service provided by the system.

For service management

The main program management services

By manually execute the main program to start the service, you must first know to save the main path. For example, manually start the Apache service, need to know the path to Apache main program can be stored, / usr / local / apche2 / bin / apachectl start to open service, / usr / local / apche2 / bin / apachectl stop to stop the service. The vast majority of software installation by source all we need to manually specify the path to start the service.

By service management services

If by rpm or yum install, the application typically creates corresponding startup script in the /etc/init.d directory, we can manage services through service command. service command actually go /etc/init.d directory, to perform procedures.

Whether it will lead to service can not start sometimes after changing the service configuration, the case did not want to stop the service down to enable the configuration, you can reload the configuration file reload parameters, or you change the configuration unaware of the new configuration is correct, or restart the service after you can use condrestart option, the system will test whether the new configuration file in question, no problem will restart, they will not use the new configuration to restart the service.

By chkconfig management start-up service

Because Linux is a server version of the operating system, it needs to be a lot of service to boot. chkconfig command can be used to manage startup items, but need to specify the run level when setting boot.

Under normal circumstances the Linux operating system can be started in the six modes (4 temporarily not in use) and are represented by the numbers: 1 for the shutdown mode, two characters representing no NFS network interface mode, represents a fully functional interface mode of characters, temporarily 4 defined using 5 represents a graphic interface mode, 6 denotes a restart mode.

Each level has started and does not start the service, view the current running through the level at which runlevel command to change run levels by init n.

By systemctl Management Services

From CentOS 7, CentOS start using the service instead of systemd daemon, the original management system starts (chkconfig) and system management services (service) related commands all be replaced by systemctl command.

Guess you like

Origin www.cnblogs.com/shamao/p/11267493.html