当前位置:   article > 正文

linux系统管理与服务器配置高志君_linux服务器管理–系统服务设置命令systemctl...

linux系统管理与服务器配置高志军

因为买过一个超算云服务器,所以前面我讲过Ubuntu服务器管理系列知识,正好最近要搞了个阿里云,用来做shiny服务器,发现服务器管理居然进化了好多,以前的知识都过时了,再记录一笔吧,真的是学习如逆水行舟,不进则退呀!

我的阿里云服务器版本是CentOS 6.5.,属于(RedHat 7, Ubuntu 15.04+, SLES 12+)  系列,是目前最新版本的服务器管理,所以大家重点是记住这个systemctl即可:

例子如下:

sudo systemctl start shiny-server

sudo systemctl stop shiny-server

sudo systemctl restart shiny-server

如果是稍微有点旧的(Ubuntu 12.04 through 14.10 and RedHat 6)

例子如下:

启动指令:sudo service iptables start

重启指令:sudo service iptables restart

关闭指令:sudo service iptables stop

如果是特别老的linux服务器,如(RedHat 5, SLES 11) ,系统太老了,关键文件存放在/etc/init.d/

sudo /sbin/service shiny-server start

sudo /sbin/service shiny-server stop

sudo /sbin/service shiny-server restart

sudo /sbin/service shiny-server reload

sudo /sbin/service shiny-server status

总结一下就是,最新的系统用的是systemctl, 是一种管制服务的主要工具, 它整合了chkconfig 与 service功能于一体。如果你查看很多教程里面提到了chkconfig 与 service,你尽管用这个systemctl替代就好了

systemctl is-enabled iptables.service

systemctl is-enabled servicename.service #查询服务是否开机启动

systemctl enable *.service #开机运行服务

systemctl disable *.service #取消开机运行

systemctl start *.service #启动服务

systemctl stop *.service #停止服务

systemctl restart *.service #重启服务

systemctl reload *.service #重新加载服务配置文件

systemctl status *.service #查询服务运行状态

systemctl --failed #显示启动失败的服务

注:*代表某个服务的名字,如http的服务名为httpd

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/一键难忘520/article/detail/917348
推荐阅读
相关标签
  

闽ICP备14008679号