summaryrefslogtreecommitdiff
path: root/lib/chef/provider/systemd_unit.rb
diff options
context:
space:
mode:
authorThom May <thom@chef.io>2018-02-07 15:29:33 +0100
committerThom May <thom@chef.io>2018-02-07 15:29:33 +0100
commit54f0d93f0811f8cf22e9cd1e33ac7044337b8130 (patch)
treef14656a651943356d7c61ec622457bb1a94c046f /lib/chef/provider/systemd_unit.rb
parentf11e054070f54e72bf0c7110d0267bdd9a8f47d5 (diff)
downloadchef-54f0d93f0811f8cf22e9cd1e33ac7044337b8130.tar.gz
remove callers of passwd ohai plugintm/disable_chatty_ohai
Signed-off-by: Thom May <thom@chef.io>
Diffstat (limited to 'lib/chef/provider/systemd_unit.rb')
-rw-r--r--lib/chef/provider/systemd_unit.rb3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/chef/provider/systemd_unit.rb b/lib/chef/provider/systemd_unit.rb
index e1853bd984..dcef93bfde 100644
--- a/lib/chef/provider/systemd_unit.rb
+++ b/lib/chef/provider/systemd_unit.rb
@@ -227,10 +227,11 @@ class Chef
def systemctl_opts
@systemctl_opts ||=
if new_resource.user
+ uid = Etc.getpwuid(new_resource.user).uid
{
:user => new_resource.user,
:environment => {
- "DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{node['etc']['passwd'][new_resource.user]['uid']}/bus",
+ "DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{uid}/bus",
},
}
else