5.2 Controlling a Service on Linux

Table of Contents Previous Next


5 Managing an Advanced Server Installation : 5.2 Controlling a Service on Linux

You can control a service at the command line with the service command. The Linux service controller mechanism allows you to start and stop the server gracefully. Using the service command to change the status of a service allows the service controller to keep track of the server status (the pg_ctl command does not alert the service controller to changes in the status of a server).
The service command can be used to manage an Advanced Server cluster, as well as the services of component software installed with Advanced Server.
service service_name action
service_name is the name of the service.
action specifies the action taken by the service command. Specify:
start to start the service.
stop to stop the service.
restart to stop and then start the service.
status to discover the current status of the service.
The Linux service command invokes a script (with the same name as the service) that resides in /etc/init.d. If your Linux distribution does not support the service command, you can call the script directly by entering:
/etc/init.d/service_name action
service_name specifies the name of the service.
action specifies the action taken by the service command. Specify:
start to start the service.
stop to stop the service.
restart to stop and then start the service.
status to discover the current status of the service.

5 Managing an Advanced Server Installation : 5.2 Controlling a Service on Linux

Table of Contents Previous Next