[root@daixuan ~]# yum install -yntsysv安装ntsysnv包
[root@daixuan ~]# ntsysv 查看ntsysv图形服务列表
[root@daixuan ~]#chkconfig--list 查看系统服务列表,6种用户模式下服务状态
NetworkManager 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
auditd 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@daixuan ~]# chkconfig --list rpcbind
rpcbind 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@daixuan ~]# chkconfig rpcbind off 关闭rpcbind服务
[root@daixuan ~]# chkconfig --list rpcbind
rpcbind 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@daixuan ~]# chkconfig rpcbind on
[root@daixuan ~]# chkconfig --list rpcbind
rpcbind 0:关闭 1:关闭 2:启用3:启用 4:启用5:启用 6:关闭
[root@daixuan ~]#chkconfig --level 34 rpcbind off指定rpcbind的3,4级别的服务关闭
[root@daixuan ~]# chkconfig --list rpcbind
rpcbind 0:关闭 1:关闭 2:启用3:关闭 4:关闭5:启用 6:关闭
写完启动脚本,可以加入到系统的服务列表中来
[root@daixuan ~]# cd /etc/init.d
[root@daixuan init.d]# ls
auditd ip6tables nfs rpcgssd sysstat
cgconfig iptables nfslock rpcidmapd udev-post
cgred kdump ntpd rpcsvcgssd vmware-tools sshd
[root@daixuan init.d]# cp sshd 123 复制sshd为123[root@daixuan init.d]# ls -l 123
-rwxr-xr-x1 root root 4621 11月 20 12:21 123 确保123有执行权限,否则无法加到服务列表中
[root@daixuan init.d]# chkconfig --list | grep 123 查看123服务,没有启动
[root@daixuan init.d]# chkconfig --add 123 --add 123,增加启动服务123
[root@daixuan init.d]# chkconfig --list | grep 123 查看启动服务123
123 0:关闭 1:关闭 2:启用 3:启用 4:启用 5:启用 6:关闭
[root@daixuan init.d]# chkconfig 123 off 设置123服务在6个启动级别都为关闭
[root@daixuan init.d]# chkconfig --list | grep 123
123 0:关闭 1:关闭 2:关闭 3:关闭 4:关闭 5:关闭 6:关闭
[root@daixuan init.d]# chkconfig --del 123 删除启动服务123
[root@daixuan init.d]# chkconfig --list | grep 123
[root@daixuan init.d]# rm -rf 123
[root@daixuan init.d]# ls
sshd