Take APACHE/HTTPD service as an example
chkconfig httpd on
task |
Red hat / fedora |
Ubuntu |
< Strong>ubuntu (with sysv-rc-conf or sysvconfig) |
start now/ Stop a service |
service httpd start |
invoke-rc.d Apache start |
service Apache start |
auto load at startup |
update-rc.d Apache defaults |
sysv-rc-conf Apache on |
start without loading |
chkconfig httpd off |
update-rc.d Apache purge |
sysv-rc-conf Apache off |
Https://help.ubuntu.com/community/SwitchingToUbuntu/FromLinux/RedHatEnterpriseLinuxAndFedora
Installing sysv-rc-conf
$ sudo apt-get install sysv-rc-conf
Usage:
sysv-rc-conf--list [service name]
sysv-rc-conf [--level <runlevels>] <service name> <on|off>
Translator by: Starting from Fedora16, Redhat no longer recommends Ntsysv, Chkconfig, and service, but recommends using the new service Management tool Systemctl (seemingly powerful) , although the old instructions are also available.
Http://docs.fedoraproject.org/en-US/Fedora/16/html/System_Administrators_Guide/ch-Services_and_Daemons.html
Comparison table, taking apache/httpd as an example
Task |
Old instructions |
New directives |
Enable a service to start automatically |
Chkconfig--level 3 httpd on |
systemctl enable httpd.service
|
Make a service not start automatically |
Chkconfig--level 3 httpd off |
systemctl disable httpd.service
|
Check Service status |
Service httpd Status |
systemctl status httpd .service (服务详细信息)
systemctl is-active httpd.service (仅显示是否 Active)
|
Show all services that have been started |
(Who knows?) ) |
systemctl list-units --type=service
|
Start a service |
Service httpd Start |
systemctl start httpd.service
|
Stop a service |
Service httpd Stop |
systemctl stop httpd.service
|
Restart a service |
Service httpd Restart |
systemctl restart httpd.service
|
Ubuntu and Redhat/fedora Service Management Command comparison table (with FEDORA16 new service management tool SYSTEMCTL)