CentOS7 systemctl的使用

# 查看正在运行的服务

systemctl

# 查看某个服务的状态

systemctl status httpd.service

# 启动服务

systemctl start  foo.service

如:systemctl start httpd.service

# 停止服务

systemctl stop foo.service

如:systemctl stop httpd.service

# 重启服务

systemctl restart foo.service

如:systemctl restart httpd.service

# 重新加载配置文件

systemctl reload  foo.service

如:systemctl reload httpd.service

# 开机时启动一个服务

systemctl enable foo.service

如:systemctl enable httpd.service

# 开机时关闭一个服务

systemctl disable foo.service

如:systemctl disable httpd.service

# 查看服务是否开机启动

systemctl is-enabled foo.service

如:systemctl is-enabled httpd.service

时间: 2024-08-24 16:29:12

CentOS7 systemctl的使用的相关文章

centos7 systemctl grub2

centos最小好化安装没有ifconfig命令 刚安装了centos7.0,最小化安装,发现没有ifconfig命令,虚拟机里面的网卡显示ens32,这是centos7.0的特点,要使用 ifconfig命令,在/etc/sysconfig/network-scripts/if-ens32里面配置好网络,记住onboot=on这个选项一定要设置,不然网络启动不了,重启网络,/etc/init.d/network restart 使用centos的官方yum源 yum clean all yum

centos7 systemctl start network报错

前几天我在虚拟机链接IP的时候 发现IP怎么也连不上了, 之后我百度查了查电脑,具体怎么修复,以下是我的故障排查整理 centos 7 (1)ifconfig   没有主机ip地址 (2)systemctl status network  报错            systemctl start network 报错     Failed to start LSB: Bring up/down networking (3)试着执行systemctl stop NetworkManager (4

centos7 systemctl status servicename执行慢的问题

一,这个问题和systemd-journald有关,故我们先简单了解下: 过去只有 rsyslogd 的年代中,由于 rsyslogd 必须要开机完成并且执行了 rsyslogd 这个 daemon 之后,登录文件才会开始记录.所以,核心还得要自己产生一个 klogd 的服务, 才能将系统在开机过程.启动服务的过程中的信息记录下来,然后等 rsyslogd 启动后才传送给它来处理. 现在有了 systemd 之后,systemd 使用systemd-journald统一管理所有 Unit 的启动

centos7 systemctl 管理 mysql

centos 7 开始使用systemctl 管理服务 服务脚本目录 /etc/systemd/system/mysql.service 脚本如下: # # Simple MySQL systemd service file # # systemd supports lots of fancy features, look here (and linked docs) for a full list: #  http://www.freedesktop.org/software/systemd/

centos7 systemctl

下机为systemctl指令systemctl enable *.service #开机运行服务systemctl disable *.service #取消开机运行systemctl start *.service #启动服务systemctl stop *.service #停止服务systemctl restart *.service #重启服务systemctl reload *.service #重新加载服务配置文件systemctl status *.service #查询服务运行状

centos7 systemctl命令

systemctl命令是系统服务管理器指令,它实际上将 service 和 chkconfig 这两个命令组合到一起. 实例: 启动nfs服务:systemctl start nfs-server.service 设置开机自启动:systemctl enable nfs-server.service 停止开机自启动:systemctl disable nfs-server.service查看服务当前状态:systemctl status nfs-server.service 重新启动某服务:sy

java jar 自启动 centos7 systemctl

我本地有一个 data-service.jar 1. 编写启动脚本  data-service-start [[email protected] shell]# more data-service-start #!/bin/sh export JAVA_HOME=/usr/local/jdk1.8.0_131 export PATH=$JAVA_HOME/bin:$PATH java -jar /data/imgcloud/data-service.jar > /data/logs/data-s

Centos7 systemctl和防火墙firewalld命令(参考https://www.cnblogs.com/marso/archive/2018/01/06/8214927.html)

一.防火墙的开启.关闭.禁用命令 (1)设置开机启用防火墙:systemctl enable firewalld.service (2)设置开机禁用防火墙:systemctl disable firewalld.service (3)启动防火墙:systemctl start firewalld (4)关闭防火墙:systemctl stop firewalld (5)检查防火墙状态:systemctl status firewalld 二.使用firewall-cmd配置端口 (1)查看防火墙

【Linux笔记】CentOS 7 systemctl、firewalld

一.CentOS7 systemctl 在CentOS7中,进行chkconfig命令操作时会发现有类似“systemctl.....”的提示,systemctl可以简单实现service和chkconfig的结合,这样通过一个命令就可以实现两个命令的功能. systemctl命令的基本操作格式是: systemctl [OPTIONS...] {COMMAND}... 以nginx服务为例,实现停止.启动.重启的动作如下: systemctl stop nginx.service system