diff options
author | Mal Graty <mal.graty@googlemail.com> | 2018-05-16 19:06:30 +0100 |
---|---|---|
committer | Mal Graty <mal.graty@googlemail.com> | 2018-05-19 00:35:58 +0100 |
commit | d436e257b5666163e02608c4afeada60e231fa88 (patch) | |
tree | f4b3b3bd1ccc6e59dcc3d6e7579ff94b01db72c3 /lib/chef/provider/service | |
parent | f8d9aea002009d49c529cc87a691c8a19de3f664 (diff) | |
download | chef-d436e257b5666163e02608c4afeada60e231fa88.tar.gz |
Fix systemd_unit user property usage
Use Etc.getpwnam rather than Etc.getpwuid, since getpwuid expects a UID
and the resource provides a string.
Signed-off-by: Mal Graty <mal.graty@googlemail.com>
Diffstat (limited to 'lib/chef/provider/service')
-rw-r--r-- | lib/chef/provider/service/systemd.rb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/chef/provider/service/systemd.rb b/lib/chef/provider/service/systemd.rb index 1bcc2f3a00..704f94a7ff 100644 --- a/lib/chef/provider/service/systemd.rb +++ b/lib/chef/provider/service/systemd.rb @@ -77,7 +77,7 @@ class Chef::Provider::Service::Systemd < Chef::Provider::Service::Simple def get_systemctl_options_args if new_resource.user - uid = Etc.getpwuid(new_resource.user).uid + uid = Etc.getpwnam(new_resource.user).uid options = { :environment => { "DBUS_SESSION_BUS_ADDRESS" => "unix:path=/run/user/#{uid}/bus", |