Skip to content

Commit ae5dfe5

Browse files
authored
Merge pull request #293 from simondeziel/resolved-stopped-fix
resolved: `onlyif` snippet requires shell support
2 parents 4989f36 + edce60b commit ae5dfe5

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

REFERENCE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@ Data type: `Enum['stopped','running']`
192192

193193
The state that the ``resolved`` service should be in. When migrating from 'running' to
194194
'stopped' an attempt will be made to restore a working `/etc/resolv.conf` using
195-
`/run/systemd/resolved/resolv.conf`.
195+
`/run/systemd/resolve/resolv.conf`.
196196

197197
Default value: `'running'`
198198

manifests/init.pp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@
2727
# @param resolved_ensure
2828
# The state that the ``resolved`` service should be in. When migrating from 'running' to
2929
# 'stopped' an attempt will be made to restore a working `/etc/resolv.conf` using
30-
# `/run/systemd/resolved/resolv.conf`.
30+
# `/run/systemd/resolve/resolv.conf`.
3131
#
3232
# @param resolved_package
3333
# The name of a systemd sub package needed for systemd-resolved if one needs to be installed.

manifests/resolved.pp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,10 @@
8787
# /etc/resolv.conf to something that might actually work on
8888
# reboot.
8989
exec { 'restore_resolv.conf_if_possible':
90-
command => 'cp --remove-destination -f /run/systemd/resolve/resolv.conf /etc/resolv.conf',
91-
onlyif => 'l="$(readlink /etc/resolv.conf)"; test "$l" = "/run/systemd/resolve/resolv.conf" || test "$l" = "/run/systemd/resolve/stub-resolv.conf',
92-
path => $facts['path'],
90+
command => 'cp --remove-destination -f /run/systemd/resolve/resolv.conf /etc/resolv.conf',
91+
onlyif => 'l="$(readlink /etc/resolv.conf)"; test "$l" = "/run/systemd/resolve/resolv.conf" || test "$l" = "/run/systemd/resolve/stub-resolv.conf',
92+
path => $facts['path'],
93+
provider => 'shell',
9394
}
9495
}
9596
}

0 commit comments

Comments
 (0)