linux 分析系统配置,Services - CentOS 7系统配置上的变化解析_Linux教程_Linux公社-Linux系统门户网站...

news/2024/5/19 19:21:59/文章来源:https://blog.csdn.net/weixin_28889007/article/details/116920003

二、Services

[root@localhost ~]# chkconfig

Note: This output shows SysV services only and does not include native

systemd services. SysV configuration data might be overridden by native

systemd 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]'.

iprdump            0:off    1:off    2:on    3:on    4:on    5:on    6:off

iprinit            0:off    1:off    2:on    3:on    4:on    5:on    6:off

iprupdate          0:off    1:off    2:on    3:on    4:on    5:on    6:off

livesys            0:off    1:off    2:off    3:on    4:on    5:on    6:off

livesys-late      0:off    1:off    2:off    3:on    4:on    5:on    6:off

netconsole        0:off    1:off    2:off    3:off    4:off    5:off    6:off

network            0:off    1:off    2:off    3:off    4:off    5:off    6:off

rhnsd              0:off    1:off    2:on    3:on    4:on    5:on    6:off

vboxadd            0:off    1:off    2:on    3:on    4:on    5:on    6:off

vboxadd-service    0:off    1:off    2:on    3:on    4:on    5:on    6:off

vboxadd-x11        0:off    1:off    2:off    3:on    4:off    5:on    6:off

SysV已经快退居二线了,想配置服务得用systemctl,先看看默认启动的服务吧。(如果不用grep过滤一下,输出结果有260多行)

[root@localhost ~]# systemctl list-unit-files|grep enabled

tmp.mount                                  enabled

accounts-daemon.service                    enabled

atd.service                                enabled

auditd.service                              enabled

avahi-daemon.service                        enabled

bluetooth.service                          enabled

chronyd.service                            enabled

crond.service                              enabled

dbus-org.bluez.service                      enabled

dbus-org.Fedoraproject.FirewallD1.service  enabled

dbus-org.freedesktop.Avahi.service          enabled

dbus-org.freedesktop.NetworkManager.service enabled

dbus-org.freedesktop.nm-dispatcher.service  enabled

display-manager.service                    enabled

dmraid-activation.service                  enabled

firewalld.service                          enabled

gdm.service                                enabled

getty@.service                              enabled

irqbalance.service                          enabled

iscsi.service                              enabled

kdump.service                              enabled

libstoragemgmt.service                      enabled

lvm2-monitor.service                        enabled

mdmonitor.service                          enabled

microcode.service                          enabled

multipathd.service                          enabled

NetworkManager-dispatcher.service          enabled

NetworkManager.service                      enabled

packagekit-offline-update.service          enabled

postfix.service                            enabled

rngd.service                                enabled

rsyslog.service                            enabled

rtkit-daemon.service                        enabled

smartd.service                              enabled

spice-vdagentd.service                      enabled

sysstat.service                            enabled

systemd-readahead-collect.service          enabled

systemd-readahead-drop.service              enabled

systemd-readahead-replay.service            enabled

tuned.service                              enabled

avahi-daemon.socket                        enabled

dm-event.socket                            enabled

iscsid.socket                              enabled

iscsiuio.socket                            enabled

lvm2-lvmetad.socket                        enabled

default.target                              enabled

multi-user.target                          enabled

remote-fs.target                            enabled

默认居然没有启动sshd,晕!看看监听端口:

[root@localhost ~]# netstat -lntp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name

tcp        0      0 127.0.0.1:25            0.0.0.0:*              LISTEN      2090/master

果然没有22,试试老办法:

[root@localhost ~]# chkconfig sshd on

Note: Forwarding request to 'systemctl enable sshd.service'.

ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service'

能用,但是指令被转发到 systemctl enable sshd.service ,以后控制服务就用这个指令了。试试:

禁用sshd:

[root@localhost ~]# systemctl disable sshd.service

rm '/etc/systemd/system/multi-user.target.wants/sshd.service'

启用sshd:

[root@localhost ~]# systemctl enable sshd.service

ln -s '/usr/lib/systemd/system/sshd.service' '/etc/systemd/system/multi-user.target.wants/sshd.service'

看看:

[root@localhost ~]# systemctl list-unit-files|grep sshd.service

anaconda-sshd.service                      static

sshd.service                                enabled

[root@localhost ~]# netstat -lntp

Active Internet connections (only servers)

Proto Recv-Q Send-Q Local Address          Foreign Address        State      PID/Program name

tcp        0      0 127.0.0.1:25            0.0.0.0:*              LISTEN      2090/master

tcp        0      0 0.0.0.0:22              0.0.0.0:*              LISTEN      2758/sshd

tcp6      0      0 :::22                  :::*                    LISTEN      2758/sshd

其实启用和禁用服务就是在当前“runlevel”的配置文件目录(/etc/systemd/system/multi-user.target.wants/)里,

建立/usr/lib/systemd/system 里面对应服务配置文件的软链接;禁用服务就是删除此软链接。

有兴趣就自己看看 /usr/lib/systemd/system 里的文件,语法跟旧版/etc/init.d/ 里的服务脚本完全不同,也不能再用 /etc/init.d/sshd restart 之类的指令启动服务器了。

先试试旧方法启动服务:

[root@localhost ~]# service sshd start

Redirecting to /bin/systemctl start  sshd.service

用新方法折腾一下:

[root@localhost ~]# systemctl start sshd.service

[root@localhost ~]# systemctl stop sshd.service

[root@localhost ~]# systemctl restart sshd.service

[root@localhost ~]#

如果没有错误,就不会输出任何信息,这个,,,,得习惯一下。0b1331709591d260c1c78e86d0c51c18.png

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.luyixian.cn/news_show_819627.aspx

如若内容造成侵权/违法违规/事实不符,请联系dt猫网进行投诉反馈email:809451989@qq.com,一经查实,立即删除!

相关文章

你所不知道的良心网站第一弹

目录前言站长工具(tool.chinaz.com)多吉搜索(www.dogedoge.com)蜜柑计划(mikanani.me)果核剥壳(www.ghpym.com)中国色(zhongguose.com)表情包(www…

你所不知道的良心网站第二弹

目录前言极简简历(polebrief.com)Logo设计(uugai.com)pdf转换 (smallpdf.com)幕布脑图(mubu.com)ProcessOn脑图(processon.com)在线ps(uupoop.com)模板码&…

你所不知道的良心网站第三弹

目录前言1、唧唧down(client.jijidown.com)2、BiliOB(biliob.com)3、包图网(ibaotu.com)4、5sing (5sing.kugou.com)5、今日热榜 (tophub.today)6、网站大全&…

Tomcat7多网站、多端口

一、说明 1.appBase为项目的绝对路径,docBase为WEB目录 2.Host下的Alias是一个域名别称,可以配置多个域名。 3.Host里如果没有Context节点,则非webapps文件夹下,直接不用虚拟目录访问,会抛404找不到文件的错误&#xf…

使用 TS Web Access 在网站上访问该程序的链接

1.1.1 使用 TS Web Access 在网站上访问该程序的链接。 能够使用TS Web访问终端服务器上的程序,客户端必须是: Windows Server 2008 Windows Vista with Service Pack 1 (SP1) Windows XP with Service Pack 3 (SP3) 示例: 1. 在Sales计算…

Squid搭建反向代理提高网站访问速度

反向代理简述: 反向代理服务器有两种传输模式: 1.同步模式:(如:squid)用户发起请求,请求立即被转到后端的服务器,于是在浏览器和后端服务器之间就建立了一个连接,在请求完…

开发出高性能的网站,第三部分:压缩和其他服务器端的技术 - 【推荐】

中文原文 http://www.uigarden.net/chinese/gao-xing-neng-iii 作者 Thomas A. Powell 和 Joe Lima 阅读本文英文原文(翻译:刘松涛)经Port80软件授权发表在第一部分 , 我们讲了代码优化的20个技巧,这些代码优化都是针对开发者源代…

开发出高性能的网站,第二部分 — 最佳缓冲控制 - 【推荐】

中文原文 http://www.uigarden.net/chinese/gao-xing-neng-ii 作者 Thomas A. Powell 和 Joe Lima 阅读本文英文原文(翻译:刘松涛)经Port80软件授权发表第二部分 — 最佳缓冲控制 本文的第一部分 (二月份)介绍了如何通…

lamp php网站,LAMP环境的搭建以及基于php动态网站的应用

1.lamp简介:lamp全称 linux apache mysql php ,所以它是由linux apache mysql php这四个环境构成,下面我们来逐个建立该环境。2.需要安装的包:yum install -y httpdyum install -y phpyum install -y mysql mysql-serveryum…

网站结构设计规划书

作者:孤剑昨天,一位mm找我,让我帮她看看她做的网站!拿过来一看,汗!果然是新手,所有的东西都放在了一起,没有任何分类,想象自己以前也是如此,而且加上这个妹妹…

计算机组成VCC,8088(8086)CPU基础知识-计算机组成原理与汇编语言-电子发烧友网站...

2.2.1 微型计算机的工作过程CPU进行简单的算术运算或逻辑运算,或从存贮器取数,将数据存放于存贮器,或由接口取数或向接口送数,这些都是一些基本动作,也称为CPU的操作。用微型计算机求解“710?”这样一个极为简单的问题…

一步一步SharePoint 2007之二十二:完美解决实现Form认证后无法再用SharePoint Designer编辑网站的问题...

一步一步SharePoint 2007之二十二:完美解决实现Form认证后无法再用SharePoint Designer编辑网站的问题摘要前面的文章中,我们采用“曲线救国”的方式解决实现Form认证后无法再用SharePoint Designer编辑网站的问题,还甚至说Microsoft公司并未…

【很好,很和谐】蒙骗了CCTV 人民网 凤凰网 网易 新浪的 特大假新闻 学生网站系统 007OS 取代Windows操作系统

事态发展 :假新闻 已经被各大媒体转载 007os相关新闻: 大三学生研发软件卖200万元成富豪(图)       cctv 学生所创办网站被亿聚网以200万价格收购(图) 央视国际 大学生研发新计算机操作系统亿聚200万收购    人民网 亿聚网200万收购华工学生个人网站007os …

LNMP:综合架构网站架构(LNMP)

原文链接:https://www.cnblogs.com/moox/p/12745458.html

基于腾讯云搭建个人网站的实验

为了研究公有云安全产品及Web安全,特意重新在腾讯云上搭建了一套博客系统,整体操作下来,和几年前在阿里云上搭建的过程大同小异,不过时过境迁,那时只是为了搭建博客,重点在博客的使用,现在重点在…

我记录网站综合系统 -- 技术原理解析[9:HttpMethodChecker流程]

源代码位置:\Web\Mvc\Processors:HttpMethodChecker.cs Config -> wojilu.Web.Mvc.CoreHandler.ProcessRequest - > wojilu.Web.Mvc.CoreHandler.ProcessRequest: ProcessContext.Begin ->Ro…

学用MVC4做网站五:5.6文章浏览(前台)

今天做文章的前台文章列表。 前台显示比较简单只显示文章标题和发布日期。 首先添加CommonModelController using Ninesky.Models; using Ninesky.Repository; using System.Web.Mvc;namespace Ninesky.Controllers {public class CommonModelController : Controller{private …

RustCon Asia 实录 | Rust 在国内某视频网站的应用

2019独角兽企业重金招聘Python工程师标准>>> 作者介绍: hawkingrei(王维真),中间件高级开发工程师,开源爱好者,TiDB & TiKV Contributor。 WaySLOG(雪松)&#xff0c…

国内有哪些好的刷题网站?

zz from: http://www.zhihu.com/question/25574458 国内有哪些好的刷题网站? 本人现在正在学习数据结构与算法,想通过刷题练习一下分析问题,解决问题的能力。请问国内有哪些好的刷题网站?添加评论 分享按投票排序按时间排序16 个回答 241赞同…

MVC4做网站后台:用户管理 —用户

这块进行用户管理,可以浏览、查询已注册的用户,修改用户资料,删除用户等。没有做添加用户,不知是否必要。列表页还是使用easyui的datagrid。这个思路跟用户组的方式差不多。 1、接口InterfaceUser 命名空间Ninesky.Repository 功能…