加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 综合聚焦 > 服务器 > Linux > 正文

linux – CentOS 7 systemctl – 没有反馈或状态/输出

发布时间:2020-12-14 02:40:57 所属栏目:Linux 来源:网络整理
导读:我刚刚在一台服务器上安装了CentOS 7.1,而且我对systemctl与服务相比的工作原理感到困惑. 在CentOS 6上,我会在运行服务时收到反馈,例如: root@centos6 [~]# service mysql restartShutting down MySQL........................................[ OK ]Starti
我刚刚在一台服务器上安装了CentOS 7.1,而且我对systemctl与服务相比的工作原理感到困惑.

在CentOS 6上,我会在运行服务时收到反馈,例如:

root@centos6 [~]# service mysql restart
Shutting down MySQL........................................[  OK  ]
Starting MySQL.............................................[  OK  ]

root@centos6 [~]# service mysql status
MySQL running (910285)                                     [  OK  ]
root@centos6 [~]#

但是在CentOS 7上,当我使用systemctl时,我什么都没得到.我不知道发生了什么,或者甚至发生了什么:

root@centos7 [~]# systemctl restart mysql
root@centos7 [~]# /bin/systemctl restart  mysql.service

# Nothing happened

当我在CentOS 7上运行服务时,会发生这种情况:

root@centos7 [~]# service mysql restart
Redirecting to /bin/systemctl restart  mysql.service

我错过了什么?

解决方法

与任何好的unix命令一样,除非出现问题,否则systemctl不会输出任何内容,或者您??运行了明确需要输出的命令.如果什么也看不见,那么命令就成功了.

如果您愿意,可以运行systemctl status mysql以查看其当前状态.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读