docker.service:服务缺少ExecStart =和ExecStop =设置。拒绝

投票

我的VM因内存不足而崩溃。重新启动计算机后,docker未运行:

systemctl status docker
● docker.service
   Loaded: error (Reason: Invalid argument)
   Active: inactive (dead)
Dec 19 08:18:21 my-vm-single-instance systemd[1]: [/lib/systemd/system/docker.service:1] Assignment outside of section. Ignoring.
Dec 19 08:18:21 my-vm-single-instance systemd[1]: docker.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

我使用官方文档安装了docker:https : //docs.docker.com/engine/install/debian/

VM正在运行:

Debian GNU/Linux 9 (stretch)
Docker version 19.03.14, build 5eb3275d40
docker-compose version 1.25.4, build 8d51620a

我启动了docker并再次运行

dockerd

但是我想让它再次通过systemctl运行。

的内容/lib/systemd/system/docker.service是:

Environment="GOOGLE_APPLICATION_CREDENTIALS=/etc/docker/key.json"

任何想法如何解决此问题?

zforgo

如果docker.service包含仅一行,则为伪造。正如它所说

docker.service: Service lacks both ExecStart= and ExecStop= setting. Refusing.

执行脚本至少丢失。

这是一个示例服务文件:

[Unit]
Description=Docker Application Container Engine
Documentation=https://docs.docker.com
After=network-online.target firewalld.service containerd.service
Wants=network-online.target
Requires=docker.socket containerd.service

[Service]
Type=notify
# the default is not to use systemd for cgroups because the delegate issues still
# exists and systemd currently does not support the cgroup feature set required
# for containers run by docker
ExecStart=/usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
ExecReload=/bin/kill -s HUP $MAINPID
TimeoutSec=0
RestartSec=2
Restart=always

# Note that StartLimit* options were moved from "Service" to "Unit" in systemd 229.
# Both the old, and new location are accepted by systemd 229 and up, so using the old location
# to make them work for either version of systemd.
StartLimitBurst=3

# Note that StartLimitInterval was renamed to StartLimitIntervalSec in systemd 230.
# Both the old, and new name are accepted by systemd 230 and up, so using the old name to make
# this option work for either version of systemd.
StartLimitInterval=60s

# Having non-zero Limit*s causes performance problems due to accounting overhead
# in the kernel. We recommend using cgroups to do container-local accounting.
LimitNOFILE=infinity
LimitNPROC=infinity
LimitCORE=infinity

# Comment TasksMax if your systemd version does not support it.
# Only systemd 226 and above support this option.
TasksMax=infinity

# set delegate yes so that systemd does not reset the cgroups of docker containers
Delegate=yes

# kill only the docker process, not all processes in the cgroup
KillMode=process
OOMScoreAdjust=-500

[Install]
WantedBy=multi-user.target

这是我的默认服务文件。安装后我从未修改过它。

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章

systemd:服务缺少ExecStart =和ExecStop =设置。拒绝

Systemd同时运行ExecStart和ExecStop

SQLSTATE [HY000] [2002]在laravel和docker设置中拒绝连接

使用Nextflow和Docker的FileNotFoundException(权限被拒绝)

Vagrant 和 Docker 之间的 Redis 连接被拒绝

使用Laravel和Docker的权限被拒绝错误

Docker Influx DB 和 Nodejs - 连接被拒绝

Docker:Golang WebApp和Postgres服务器之间的连接被拒绝

设置授权和“拒绝访问”页面

如何正确设置我的 systemd 服务 ExecStart?

无法使用go和docker连接到mysql服务器-拨打TCP 127.0.0.1:3306:连接:连接被拒绝

使用docker和ansible iptables拒绝传入流量

使用ChromeDriver,Capybara和Docker Compose的“拒绝连接”

spring-client与docker和gradle的连接被拒绝

Docker:docker run和docker service之间的区别

我使用traefik和docker进行的反向代理设置无法解析Web服务器地址

服务启动和权限被拒绝

设置docker ip和port阻止我使用docker ps -a

使用 Docker 和 VSCode 设置 XDebug

在Docker上设置Mesos和Kubernetes的命令?

docker-compose的nginx和django设置

通过docker和postgres设置nextcloud

Docker:如何管理开发和生产设置?

Node + Docker Compose:开发和生产设置

为sharp库设置webpack和docker

Docker中的两个微服务拒绝连接

C#+ C ++中的Windows服务拒绝在Docker中启动

Docker容器中的数据库容器和Java容器之间的Docker容器中的连接被拒绝

使用Docker 1.12服务设置的Mongodb副本