Skip to content

Commit ef72742

Browse files
committed
fix(service): change default service name
Docker daemon service name in official Docker packages is 'docker' but formula uses 'dockerd'. Due to these differences docker service won't start after installation. Fix documentation link in systemd service Docker daemon binary in official Docker archive distribution is always 'dockerd' no reason to substitute service name 'null' from yaml is rendering as 'None' by Jinja therefore, systemd displays a warning in the log, replace with empty string to prevent this issue BREAKING CHANGE: due changes in default service name, on systems where 'archive' installation method is used, duplicate service will be created. This can be avoided by updating pillar with 'docker:pkg:docker:service:name: dockerd'. Due fact that 'archive' method is default this change may affect a large number of users
1 parent 3c3b49c commit ef72742

File tree

5 files changed

+10
-8
lines changed

5 files changed

+10
-8
lines changed

docker/defaults.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ docker:
3939

4040
name: docker-ce
4141
service:
42-
name: dockerd
43-
env: null
42+
name: docker
43+
env: ''
4444
suffix: tgz
4545
commands:
4646
- docker

docker/files/default/systemd.ini.jinja

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
Description={{ desc }}
66
Wants=network-online.target
77
After=
8-
Documentation=https://github.com/saltstack-formulas/prometheus-formula
8+
Documentation=https://docs.docker.com
99

1010
[Service]
1111
User={{ user }}

docker/software/archive/install.sls

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -94,7 +94,7 @@
9494
workdir: {{ d.dir.lib }}
9595
env: {{ d.pkg.docker.service.env }}
9696
stop: ''
97-
start: {{ d.pkg.docker.path }}/{{ d.pkg.docker.service.name }}
97+
start: {{ d.pkg.docker.path }}/dockerd
9898
cmd.run:
9999
- name: systemctl daemon-reload
100100
- require:

docker/software/service/running.sls

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,13 @@ include:
4444
{%- endif %}
4545
- enable: True
4646
{%- if grains.kernel|lower == 'linux' %}
47-
- onlyif: systemctl list-unit-files | grep {{ d.pkg.docker.service.name }} >/dev/null 2>&1
4847
4948
{{ formula }}-software-service-running-docker-fail-notify:
50-
test.show_notification:
51-
- text: |
52-
* Rebooting your host is recommended!
49+
test.fail_without_changes:
50+
- comment: |
51+
Formula is trying to start '{{ d.pkg.docker.service.name }}' service
52+
but failed, is it a correct name for Docker service in your OS?
53+
5354
In certain circumstances the docker service will not start.
5455
Your kernel is missing some modules, or not in ideal state.
5556
See https://github.com/moby/moby/blob/master/contrib/check-config.sh

pillar.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ docker:
99
pkg:
1010
docker:
1111
service:
12+
name: docker
1213
env: HTTP_PROXY=http://YOUR_PROXY_IP_ADDRESS:PROXY_PORT
1314
environ:
1415
# yamllint disable-line rule:line-length

0 commit comments

Comments
 (0)