`
m635674608
  • 浏览: 4930392 次
  • 性别: Icon_minigender_1
  • 来自: 南京
社区版块
存档分类
最新评论

服务管理--systemctl命令

 
阅读更多

http://my.oschina.NET/5lei/blog/191370

 

任务 旧指令 新指令
使某服务自动启动 chkconfig --level 3 httpd on systemctl enable httpd.service
使某服务不自动启动 chkconfig --level 3 httpd off systemctl disable httpd.service
检查服务状态 service httpd status systemctl status httpd.service (服务详细信息) systemctl is-active httpd.service (仅显示是否 Active)
显示所有已启动的服务 chkconfig --list systemctl list-units --type=service
启动某服务 service httpd start systemctl start httpd.service
停止某服务 service httpd stop systemctl stop httpd.service
重启某服务 service httpd restart systemctl restart httpd.service

 

 

下面以nfs服务为例:

1.启动nfs服务

systemctl start nfs-server.service

2.设置开机自启动

systemctl enable nfs-server.service

3.停止开机自启动

systemctl disable nfs-server.service

4.查看服务当前状态

systemctl status nfs-server.service

5.重新启动某服务

systemctl restart nfs-server.service

6.查看所有已启动的服务

systemctl list -units --type=service

开启防火墙22端口

iptables -I INPUT -p tcp --dport 22 -j ACCEPT

如果仍然有问题,就可能是SELinux导致的

关闭SElinux:

修改/etc/selinux/config文件中的SELINUX=”” 为 disabled,然后重启

彻底关闭防火墙:

sudo systemctl status  firewalld.service
sudo systemctl stop firewalld.service          
sudo systemctl disable firewalld.service

http://blog.csdn.net/hshl1214/article/details/51076525

分享到:
评论

相关推荐

    Linux服务器配置与管理:systemctl服务管理.pptx

    会使用systemctl命令管理服务(查看服务状态、设置服务运行级别、控制服务的启动状态 【思政目标】 理论与实践是相辅相成的,缺一不可的。实践是检验真理的唯一标准,引导学生注重实践操作,在实践中检验理论,促进...

    systemctl命令 管理系统服务

    Centos7之后从init完全换成了systemd的启动方式,systemd 启动服务的机制主要是通过 systemctl 的这个系统服务管理指令来处理。systemctl在用法上也囊括 service / chkconfig / setup / init 的大部分功能。 语法...

    详细讲解systemctl(附常用指令)

    目录 •写在前面 •systemd和systemctl •systemd的配置文件目录 •主要服务功能类型 •服务状态 •常用指令 ...我们提到systemctl就一定需要知道systemd,因为Linux 服务管理有两种方式service和system

    使用 Systemctl 命令来管理系统服务.doc

    Systemctl是systemd用于管理系统和管理服务的工具。许多现代Linux发行版,如Ubuntu、Debian、Fedora、Linux Mint、OpenSuSE、Redhat都采用systemd作为默认的init系统。

    linux systemctl命令详解

    由于 systemd 相关的绝大多数任务都是通过 systemctl 命令管理的,所以本文将集中的介绍 systemctl 命令的用法。注意,本文以 ubuntu 16.04 进行介绍,文中所有的 demo 都在 ubuntu 16.04 中完成。 systemctl 命令有...

    systemctl 管理tomcat.txt

    CentOS7 增加tomcat 启动,停止,使用systemctl进行配置详解!centos7 使用 systemctl 替换了 service命令

    Linux systemctl 命令完全指南

    Systemctl是一个systemd工具,主要负责控制systemd系统和服务管理器。下面介绍一下Linux systemctl 命令完全指南。

    《Linux服务器配置与管理》教学课件—第-11-章--MySQL-服务器配置.pptx

    第11章 邮件服务器配置 《Linux服务器配置与管理》教学课件—第-11-章--MySQL-服务器配置全文共59页,当前为第1页。...启动 MySQL 服务 [root@kangvcar ~]# systemctl start mysqld ### 启动 MySQL 服务器 [roo

    《Linux服务器配置与管理》教学课件—第-15-章--Samba-服务器配置.pptx

    如果用户希望系统在启动时就自动加载 Samba 服务,则可以使用如下命令设置开机 自启动: [root@master ~]# chkconfig smb on 注意:正在将请求转发到"systemctl enable smb.service"。 Created symlink from /etc/...

    详解Linux 服务管理两种方式service和systemctl

    1.service命令 service命令其实是去/etc/init.d目录下,去执行相关程序 # service命令启动redis脚本 service redis start # 直接启动redis脚本 /etc/init.d/redis start # 开机自启动 ...1)systemctl命令

    《Linux服务器配置与管理》教学课件—第-12-章--FTP-服务器配置.pptx

    命令如下: [root@ a1 ~]#hostnamectl set-hostname a1 [root@ a1 ~]#ifconfig eth0 192.168.37.133 netmask 255.255.255.0 12.1.1 前期准备 《Linux服务器配置与管理》教学课件—第-12-章--FTP-服务器配置全文共33...

    Linux系统中systemctl命令详解

    Linux Systemctl是一个系统管理守护进程、工具和库的集合,用于取代System V、service和chkconfig命令,初始进程主要负责控制systemd系统和服务管理器

    Linux教程,主要内容:Linux 命令、Linux 系统运维、软件运维、精选常用Shell脚本.zip

    linux教程: 查看 Linux 命令帮助信息 - 关键词:help, whatis, info, which, where...Linux 系统管理 - 关键词:reboot, exit, shutdown, date, mount, umount, ps, kill, systemctl, service, crontab Linux 网络管理

    使用 chkconfig 和 systemctl 命令启用或禁用 Linux 服务的方法

    对于 Linux 管理员来说这是一个重要(美妙)的话题,所以每个人都必须知道,并练习怎样才能更高效的使用它们。 在 Linux 中,无论何时当你安装任何带有服务和守护进程的包,系统默认会把这些服务的初始化及 systemd ...

    Centos7离线安装Cockpit 依赖包(navigator文件管理器)

    3.使用以下命令,将Cockpit服务设置为开机自启动 systemctl enable cockpit 4.开启防火墙 firewall-cmd --zone=public --add-service=cockpit --permanent firewall-cmd --reload 5.打开浏览器进行访问测试,...

    Linux操作系统实验三.doc

    (3)systemctl 命令:系统服务管理 查看系统服务启动状态。其格式: systemctl list-unit-files --type service 列出所有处于激活状态的服务。其格式为: systemctl list-units --type service --all 服务状态控制。其...

    Kiwi-Syslog日志服务器搭建.doc

    1. 安装要求: 系统:windows 2012 R2 Standerd 环境:安装.net3.5和web服务 软件版本:K + SolarWinds Event Log Forwarder for Windows 日志服务器IP: 2. 安装过程: 运行开始安装: 至此,Kiwi Syslog server...

    Linux系统命令systmctl源码

    Linux系统命令systmctl源码,适合学习systemctl命令的源码研究

    Red hat 服务管理.txt

    (RHCE)备考 Linux入门到精通系列之 服务管理 systemctl 提供了一组子命令来管理单个的 unit,其命令格式为: systemctl [command] [unit]

Global site tag (gtag.js) - Google Analytics