Oracle 8i | Oracle 9i | Oracle 10g | Oracle 11g | Oracle 12c | Miscellaneous | PL/SQL | SQL | Oracle RAC | Oracle Apps | Linux

Linux Services (service, chkconfig, system-config-services)

This article describes the commands to manage services on Linux, with specific reference to the information needed for the RHCSA EX200 and RHCE EX300 exams.

Remember, the exams are hands-on, so it doesn't matter which method you use to achieve the result, so long as the end product is correct.

service

The service command is used to stop, start, restart and check the status of a specified service.

# service httpd stop
# service httpd start
# service httpd restart
# service httpd status

Use the following command to get the status of all services.

# service --status-all

To fully restart a service (a separate stop then start) use the following command.

# service httpd --full-restart

The auto-start toggles for services are also available using a text-based tool initiated from the command line using the setup command.

chkconfig

The chkconfig command performs a number of service management tasks. To enable and disable services to auto-start at reboot, use the following commands.

# chkconfig httpd on
# chkconfig httpd off

The "--level" flag allows auto-start to be limited to specific run levels.

# chkconfig --level 35 httpd on

The "--list" option displays all the run levels a specific service is associated with.

# chkconfig --list httpd
httpd          	0:off	1:off	2:on	3:on	4:on	5:on	6:off
#

The "-add" and "-del" options are used to initiate and drop management of a service, based on an init script in the "/etc/init.d" directory. When using "-add", the content of the init script determines which run levels the service is assigned to. An example of using the "-add" to manually create a new service is shown here.

system-config-services

The "Service Configuration" dialog is available from the menu (System > Administration > Services) or directly from the command line by running the system-config-services command.

Service Configuration

The "Enable" and "Disable" buttons are used to toggle the auto-start on reboot for each service. The "Start", "Stop" and "Restart" buttons affect the current state of the service.

Creating Linux Services

Although not necessary for the RHCSA exam, it's an important topic for Oracle database administrators. For an example of creating a service in Linux, check out this article.

For more information see:

Hope this helps. Regards Tim...

Back to the Top.