A single computer may have a lot of service running in the background, for example on my lubuntu i have apache web server, mysql database server, and php fpm running in the background, these are services. So how do i start and stop these services?
Lucky for us lubuntu users, lubuntu/ubuntu have special command line tool for starting, stopping, and restarting a service, it's also possible to get the status of the service. The tool for managing services is called service and this tool need to run under root permission.
1. Showing status of all services
service --status-all2. How to stop a running service
sudo service [service-name] stopExamplesudo service mysql stopsudo service apache2 stop3. How to start a service
sudo service [service-name] startExample sudo service apache2 startsudo service nginx start4. How to restart a service
sudo service [service-name] restartor sudo service [service-name] reloadExample sudo service nginx reloadsudo service nginx restartsudo service mysql restart5. How to show status of a service
sudo service [service-name] statusExample sudo service apache2 statussudo service mysql statusThe service command also have other parameters that might be useful for you:
- force-reload
- configtest
- rotate
- upgrade

Không có nhận xét nào
Đăng nhận xét