Starting and Stopping Services Manually


If you change a configuration file for a system service, it is usually necessary to stop and restart the service to make it read the new configuration. If you are reconfiguring the X server, it is often convenient to change from runlevel 5 to runlevel 3 to make testing easier and then switch back to runlevel 5 to re-enable the graphical login. If a service is improperly configured, it is easier to stop and restart it until you have it configured correctly than it is to reboot the entire machine.

The traditional way to manage a service (as root) is to call the service's /etc/init.d name on the command line with an appropriate keyword, such as start, status, or stop. For example, to start the Apache web server, call the /etc/init.d/apache2 script like this:

sudo /etc/init.d/apache2 start Starting apache 2.0 web server                                 [ OK ] 


The script will execute the proper program(s) and report the status of it. Stopping services is equally easy, using the stop keyword.



Ubuntu Unleashed
Ubuntu Unleashed 2011 Edition: Covering 10.10 and 11.04 (6th Edition)
ISBN: 0672333449
EAN: 2147483647
Year: 2006
Pages: 318

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net