1、跟服务相关的基本使用命令:
service --status-all # 查看系统所有的后台服务进程
service sshd status # 查看指定的后台服务进程的状态
service sshd stop # 停止
service sshd start # 开始
service sshd restart # 重启
2、配置后台服务进程的开机自启
chkconfig httpd on ## 让httpd服务开机自启
chkconfig httpd off ## 让httpd服务开机不要自启
[root@hadoop01 mnt]# chkconfig httpd off
[root@hadoop01 mnt]# chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:off 4:off 5:off 6:off
[root@hadoop01 mnt]# chkconfig --level 35 httpd on
[root@hadoop01 mnt]# chkconfig --list | grep httpd
httpd 0:off 1:off 2:off 3:on 4:off 5:on 6:off