当前位置: 首页 > news >正文

互联网建网站站长号

互联网建网站,站长号,个人备案网站可以做商城吗,做网站报价出名的案例:通过脚本实现仅sshd、rsyslog、crond、network、sysstat服务在开机时自启动。 Linux系统在开机的服务通常工作在文本模式3级别,因此只需要查找3级别以上的开启的服务即可。查看命令: chkconfig --list |grep 3:on [rootvm1 ~]# chkco…

案例:通过脚本实现仅sshd、rsyslog、crond、network、sysstat服务在开机时自启动。

Linux系统在开机的服务通常工作在文本模式3级别,因此只需要查找3级别以上的开启的服务即可。查看命令:

chkconfig --list |grep 3:on
[root@vm1 ~]# chkconfig --list |grep 3:onNote: This output shows SysV services only and does not include nativesystemd services. SysV configuration data might be overridden by nativesystemd configuration.If you want to list systemd services use 'systemctl list-unit-files'.To see services enabled on particular target use'systemctl list-dependencies [target]'.network         0:off   1:off   2:on    3:on    4:on    5:on    6:off
[root@vm1 ~]#

默认情况下开启的服务比较少,只有network。

[root@vm1 ~]# for name in `chkconfig --list |grep 3:on|awk '{print $1}'`;do chkconfig --level 3 $name off;doneNote: This output shows SysV services only and does not include nativesystemd services. SysV configuration data might be overridden by nativesystemd configuration.If you want to list systemd services use 'systemctl list-unit-files'.To see services enabled on particular target use'systemctl list-dependencies [target]'.[root@vm1 ~]# for name in crond network rsyslog sshd sysstat;do chkconfig --level 3 $name on;done
Note: Forwarding request to 'systemctl enable crond.service'.
Note: Forwarding request to 'systemctl enable rsyslog.service'.
Note: Forwarding request to 'systemctl enable sshd.service'.
error reading information on service sysstat: No such file or directory[root@vm1 ~]# chkconfig --list |grep 3:on

说明:将默认开启的服务都关闭,然后开启需要开启的服务。

方法2:

[root@vm1 ~]# for name in `chkconfig --list|grep 3:on|awk '{print $1}'|grep -vE "crond|network|sshd|rsyslog|sysstat"`;do chkconfig $name off;doneNote: This output shows SysV services only and does not include nativesystemd services. SysV configuration data might be overridden by nativesystemd configuration.If you want to list systemd services use 'systemctl list-unit-files'.To see services enabled on particular target use'systemctl list-dependencies [target]'.

Linux系统管理员,需要遵循的原则是最小化原则,尽量不安装不使用的软件,尽量不开启不需要开启的服务,只要不用,就不开启。

我们再理解下for循环语句的结构。chkconfig命令获取到取值变量列表,然后for循环语句“遍历”这个列表,进行处理。

http://www.dinnco.com/news/386.html

相关文章:

  • 网站公告左右滚动如何优化网站
  • 做图模板网站免费搜索引擎推广方法有哪些
  • 青海网站制作公司网站外贸推广
  • php网站开发实施方案优化什么意思
  • 怎么免费做个人网站seo在线优化平台
  • 网站如何做seo的百度推广费用多少
  • 商丘网站建设软件公司淘宝seo搜索引擎优化
  • 模板网站怎么建设营销软文案例
  • 各大网站怎么把世界杯做头条品牌网络推广方案
  • 公司logo设计要求有哪些四平网站seo
  • 微博上如何做网站推广网站快速排名互点软件
  • 微网站微网站如何在百度投放广告
  • 常州网站制作机构整站优化提升排名
  • 网页站点的建立流程google play三件套
  • 营销型网站三要素高清免费观看电视网站
  • 做网站后的总结上海网站推广排名公司
  • 烟台58同城网站建设专业的网站建设公司
  • 建高铁站赚钱吗公司以优化为理由裁员合法吗
  • 安康市住房和城乡建设局网站浙江网站推广
  • 临沂建设局网站官网排行榜软件
  • 医院做网站备案都需要什么seo搜索引擎优化怎么优化
  • 个人备案的网站可以做商城吗合肥网络推广培训学校
  • 济南百度推广优化重庆seo外包平台
  • 娱乐网站建设免费seo优化工具
  • 剪辑课程哪里培训最好网站百度关键词seo排名优化
  • 网站访问量 显示代码宁波seo优化项目
  • 什么平台可以做网站帮别人推广app赚钱
  • 风水网站模板沈阳seo排名优化软件
  • 网站的搜索框如何做发布悬赏任务的推广平台
  • 网站怎么做sem正规教育培训机构