systemd

Service3

一曲冷凌霜 提交于 2020-01-29 09:03:38
RAID阵列概述 • 廉价冗余磁盘阵列 – 通过硬件/软件技术,将多个较小/低速的磁盘整合成一个大磁盘 – 阵列的价值:提升I/O效率、硬件级别的数据冗余 – 不同RAID级别的功能、特性各不相同 ################################################### 进程管理 程序:静态没有执行的代码,占用磁盘空间 进程:执行的代码放入内存中运行,占用内存、cpu PID:编号,标识进程 父进程、子进程 #################################################### 查看进程树 • pstree — Processes Tree – 格式:pstree [选项] [PID或用户名] • 常用命令选项 – -a:显示完整的命令行 – -p:列出对应PID编号 systemd:内核直接运行的第一个进程,PID永远为1 [root@svr7 ~]# pstree [root@svr7 ~]# pstree lisi bash───vim [root@svr7 ~]# pstree -p lisi bash(30712)───vim(30751) [root@svr7 ~]# pstree -ap lisi ################################################# • ps

linux的systemctl服务及其使用

烂漫一生 提交于 2020-01-29 03:52:53
一.systemd 系统初始化程序,系统开始的第一个进程,PID为1 二.systemctl命令 systemctl list-units ##列出当前系统服务的状态 systemctl list-unit-files ##列出服务的开机状态 systemctl status sshd ####看查指定服务的状态 systemctl stop sshd 关闭指定服务 systemctl start sshd ##开启指定服务 systemctl restart sshd ##重新启动服务 systemctl enable sshd ##设定指定服务开机开启,可以使用 systemctl disable sshd ##设定指定服务开机关闭,无法使用 systemctl reload sshd ##指定服务重新加栽配置 systemctl list-dependencies sshd 查看指定服务的依赖关系 systemctl mask sshd 冻结服务 systemctl unmask sshd 启动服务 systemctl set-default multi-user.target 开机不开启图形 systemctl set-default graphical. target 开机启动图形 setterm 文本界面设置颜色 systemctl set-default multi

“systemd”命令管理各类服务

£可爱£侵袭症+ 提交于 2020-01-28 15:29:12
一、centos7、red hat7 取消了运行级别的概念,用systemd代替了init中的运行级别概念。 二、用“ln”命令把“多用户,无图形”目标文件链接到/etc/systemd/system/目录中: # ln -sf /lib/systemd/system/multi-user.target /etc/systemd/system/default.target 注:实现开机进入命令行界面。 三、使用“systemctl”命令管理服务 systemctl star 服务名.service 启动服务 systemctl restart 服务名.service 重启服务 systemctl stop 服务名.service 停止服务 systemctl reload 服务名.service 重新加载配置文件(不终止服务) systemctl status 服务名.service 查看服务状态 四、使用“systemctl”设置开机启动、不启动、查看各级别下服务启动状态 systemctl enable 服务名.service 开机自启服务 systemctl disable 服务名.service 开启不自启服务 systemctl is-enabled 服务名.service 查看特定服务是否开机自启 systemctl list-unit-files --type

RHEL7运行级别和服务

寵の児 提交于 2020-01-28 02:57:46
一 RHEL7运行级别 systemd使用“target”而不是运行级。默认情况下,有两个主要 target:multi-user.target:类似于运行级别3 graphical.target:类似于运行级5 1)查看当前默认目标,运行: systemctl get-default 2)设置一个默认目标,运行: systemctl set-default TARGET.target 3)查看默认运行级别 [root@ RHEL 7 ~]# systemctl get-default multi-user.target 4)设置默认的运行级别 [root@ RHEL 7 ~]# systemctl set-default multi-user.target rm '/etc/systemd/system/default.target' ln -s '/usr/lib/systemd/system/multi-user.target' '/etc/systemd/system/default.target' 5)切换运行级别 [root@ RHEL 7 ~]# systemctl isolate multi-user.target 二 RHEL7服务 systemd 的主要的命令行工具是systemctl 注意:servic和 chkconfig 在引进systemd 照常可以使用

ubuntu-base-16.04-core-armhf enable systemctl/systemd/dev-ttyAMA0

百般思念 提交于 2020-01-27 03:52:27
1. buildroot/lfs 可以不使用systemd, 2. Ubuntu/Debian 依赖systemd . 内核编译需要CONFIG_FHANDLE Refer to https://github.com/systemd/systemd/blob/master/README REQUIREMENTS: Linux kernel >= 3.13 Linux kernel >= 4.2 for unified cgroup hierarchy support Kernel Config Options: CONFIG_DEVTMPFS CONFIG_CGROUPS (it is OK to disable all controllers) CONFIG_INOTIFY_USER CONFIG_SIGNALFD CONFIG_TIMERFD CONFIG_EPOLL CONFIG_NET CONFIG_SYSFS CONFIG_PROC_FS CONFIG_FHANDLE (libudev, mount and bind mount handling) Kernel crypto/hash API CONFIG_CRYPTO_USER_API_HASH CONFIG_CRYPTO_HMAC CONFIG_CRYPTO_SHA256 udev will fail to work

linux命令s---systemctl

白昼怎懂夜的黑 提交于 2020-01-26 19:41:18
1、查看防火墙: systemctl status firewalld。 2、临时操作: systemctl start firewalld systemctl stop firewalld 3、永久生效,但是需要重启: systemctl enable firewalld systemctl disable firewalld 4、systemd有重启次数限制,如下命令可以复位重启次数 /bin/systemctl reset-failed ceph-mon@`hostname`.service 来源: CSDN 作者: 学无止境966 链接: https://blog.csdn.net/qq_23929673/article/details/94059561

REDHAT7.2解决docker启动失败问题

时间秒杀一切 提交于 2020-01-26 02:39:54
问题: [root@localhost ~]# service docker restart Redirecting to /bin/systemctl restart docker.service Job for docker.service failed because start of the service was attempted too often. See "systemctl status docker.service" and "journalctl -xe" for details. 然后查看日志内容如下: -- Unit docker.service has begun starting up. 9月 20 15:23:49 localhost.localdomain dockerd[2591]: unable to configure the Docker daemon with file /etc/docker/daemon.json: unexpected EOF 9月 20 15:23:49 localhost.localdomain systemd[1]: docker.service: main process exited, code=exited, status=1/FAILURE 9月 20 15:23:49 localhost

centos 7.5关闭图形界面

天涯浪子 提交于 2020-01-25 14:52:19
1、获取默认的target [root@centos7 ~]# systemctl get-default graphical.target 2、取消图形界面 [root@centos7 ~]# systemctl set-default multi-user.target Removed symlink /etc/systemd/system/default.target. Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/multi-user.target. 3、图形界面启动 [root@centos7 ~]# systemctl set-default graphical.target Removed symlink /etc/systemd/system/default.target. Created symlink from /etc/systemd/system/default.target to /usr/lib/systemd/system/graphical.target. 4、设置target 之后重启机器 reboot 来源: 51CTO 作者: 小精灵linux 链接: https://blog.51cto.com/13718453

linux入门(三)Systemd指令、防火墙

走远了吗. 提交于 2020-01-25 12:26:35
Systemd指令 介绍: 是为系统的启动和管理提供一套完整的解决方案。 systemd不是一个命令,而是一组命令,涉及到系统管理的方方面面。 指令 查看版本信息 systemctl --version systemctl 是systemd的主命令,用于管理系统 重启系统 systemctl reboot 关闭系统,切断电源 systemctl poweroff cpu停止工作 systemctl halt 暂停系统 systemclt suspend 让系统进入冬眠状态 systemclt hibernate 让系统进入交互式休眠 systemctl hybrid-sleep 启动进入救援状态 systemctl critical-chain atd.service systemd-analyze 用于查看启动耗时 查看启动耗时 systemd-analyze 查看每个服务的启动耗时 systemd-analyze blame 显示瀑布状的启动过程流 systemd-analyze critical-chain 显示指定服务的启动流 systemd-analyze critical-chain atd.service hostnamectl 用于查看当前主机的信息 查看主机信息 hostnamectl 设置主机名 hostnamectl set-hostname 主机名

CentOS7关闭防火墙方法

穿精又带淫゛_ 提交于 2020-01-25 10:07:58
在之前的版本中关闭防火墙等服务的命令是 service iptables stop /etc/init.d/iptables stop 在RHEL7中,其实没有这个服务 [root@rhel7 ~]# cat /etc/redhat-release Red Hat Enterprise Linux Server release 7.0 (Maipo) [root@rhel7 ~]# service iptables stop Redirecting to /bin/systemctl stop iptables.service [root@rhel7 ~]# /etc/init.d/iptables stop -bash: /etc/init.d/iptables: No such file or directory 原来在RHEL7开始,使用systemctl工具来管理服务程序,包括了service和chkconfig [root@rhel7 ~]# systemctl list-unit-files|grep enabled cups.path enabled abrt-ccpp.service enabled abrt-oops.service enabled abrt-vmcore.service enabled abrt-xorg.service enabled