Q: How to add or remove a service from startup? (Fedora,CentOS,Redhat)
Add a service to startup
[root@server ~#]chkconfig <service> on
[root@server ~#]chkconfig sshd on
[root@server ~#]chkconfig sshd on --level 35 (add to startup in runlevels 3 and 5)
Remove a service from startup
[root@server ~#]chkconfig <service> off
[root@server ~#]chkconfig sshd off
[root@server ~#]chkconfig sshd off --level 5 (remove from startup only in runlevel 5)
Display Startup status of services
[root@server ~#]chkconfig sshd --list (List the startup status of sshd )
sshd 0:off 1:off 2:on 3:on 4:on 5:on 6:off
(The output says, sshd is added to statup in 2, 3, 4, 5 run levels)
List the startup status of all services
[root@server ~#]chkconfig --list (List the startup status of all services)
0 comments:
Post a Comment