linux计划任务的服务,Linux计划任务和系统服务 crontab、ntsysv、chkconfig

[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

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值