查看“Systemctl”的源代码
←
Systemctl
跳到导航
跳到搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看和复制此页面的源代码。
Query or send control commands to the systemd manager. 查询或发送控制命令到系统(后台服务)管理器 === status === Show runtime status of one or more units 显示一个或多个单元的运行状态<syntaxhighlight lang="shell-session"> [root@localhost ~]# systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) Active: inactive (dead) Docs: https://docs.docker.com [root@localhost ~]# </syntaxhighlight> === start === Start (activate) one or more units 启动(激活)一个或多个单位<syntaxhighlight lang="shell-session"> [root@localhost ~]# systemctl start docker.service [root@localhost ~]# systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled) Active: active (running) since Wed 2022-08-17 05:03:39 CST; 8s ago Docs: https://docs.docker.com Main PID: 2097 (dockerd) Tasks: 45 Memory: 151.4M CGroup: /system.slice/docker.service ├─2097 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock ├─2288 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 2183 -container-ip 172.20.0.2 -container-port 2181 ├─2294 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 2183 -container-ip 172.20.0.2 -container-port 2181 ├─2304 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 2181 -container-ip 172.20.0.3 -container-port 2181 ├─2310 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 2181 -container-ip 172.20.0.3 -container-port 2181 ├─2322 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 2182 -container-ip 172.20.0.4 -container-port 2181 └─2327 /usr/bin/docker-proxy -proto tcp -host-ip :: -host-port 2182 -container-ip 172.20.0.4 -container-port 2181 Aug 17 05:03:33 localhost dockerd[2097]: time="2022-08-17T05:03:33.559559666+08:00" level=info msg="ccResolverWrapper: sending update to cc: {[{unix:///run/containerd/containerd.sock <nil> 0 <nil>}] <nil> <nil>}" module=grpc Aug 17 05:03:33 localhost dockerd[2097]: time="2022-08-17T05:03:33.559565367+08:00" level=info msg="ClientConn switching balancer to \"pick_first\"" module=grpc Aug 17 05:03:33 localhost dockerd[2097]: time="2022-08-17T05:03:33.573102663+08:00" level=info msg="[graphdriver] using prior storage driver: overlay2" Aug 17 05:03:33 localhost dockerd[2097]: time="2022-08-17T05:03:33.845547050+08:00" level=info msg="Loading containers: start." Aug 17 05:03:34 localhost dockerd[2097]: time="2022-08-17T05:03:34.576992258+08:00" level=info msg="Default bridge (docker0) is assigned with an IP address 172.17.0.0/16. Daemon option --bip can be used to set a preferred IP address" Aug 17 05:03:39 bogon dockerd[2097]: time="2022-08-17T05:03:39.242556129+08:00" level=info msg="Loading containers: done." Aug 17 05:03:39 bogon dockerd[2097]: time="2022-08-17T05:03:39.351245831+08:00" level=info msg="Docker daemon" commit=a89b842 graphdriver(s)=overlay2 version=20.10.17 Aug 17 05:03:39 bogon dockerd[2097]: time="2022-08-17T05:03:39.351377939+08:00" level=info msg="Daemon has completed initialization" Aug 17 05:03:39 bogon systemd[1]: Started Docker Application Container Engine. Aug 17 05:03:39 bogon dockerd[2097]: time="2022-08-17T05:03:39.466942476+08:00" level=info msg="API listen on /var/run/docker.sock" [root@localhost ~]# </syntaxhighlight> 启用后台服务开机自启动<syntaxhighlight lang="shell-session"> [root@zk0 ~]# systemctl enable docker.service Created symlink from /etc/systemd/system/multi-user.target.wants/docker.service to /usr/lib/systemd/system/docker.service. [root@zk0 ~]# systemctl status docker.service ● docker.service - Docker Application Container Engine Loaded: loaded (/usr/lib/systemd/system/docker.service; enabled; vendor preset: disabled) Active: inactive (dead) Docs: https://docs.docker.com [root@zk0 ~]# </syntaxhighlight>
返回至
Systemctl
。
导航菜单
个人工具
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
导航
首页
Spring Boot 2 零基础入门
Spring Cloud
Spring Boot
设计模式之禅
VUE
Vuex
Maven
算法
技能树
Wireshark
IntelliJ IDEA
ElasticSearch
VirtualBox
软考
正则表达式
程序员精讲
软件设计师精讲
初级程序员 历年真题
C
SQL
Java
FFmpeg
Redis
Kafka
MySQL
Spring
Docker
JMeter
Apache
Linux
Windows
Git
ZooKeeper
设计模式
Python
MyBatis
软件
数学
PHP
IntelliJ IDEA
CS基础知识
网络
项目
未分类
MediaWiki
镜像
问题
健身
国债
英语
烹饪
常见术语
MediaWiki帮助
工具
链入页面
相关更改
特殊页面
页面信息