summaryrefslogtreecommitdiff
path: root/lib/chef/provider/service
diff options
context:
space:
mode:
authorMal Graty <mal.graty@googlemail.com>2018-05-16 19:06:30 +0100
committerMal Graty <mal.graty@googlemail.com>2018-05-19 00:35:58 +0100
commitd436e257b5666163e02608c4afeada60e231fa88 (patch)
treef4b3b3bd1ccc6e59dcc3d6e7579ff94b01db72c3 /lib/chef/provider/service
parentf8d9aea002009d49c529cc87a691c8a19de3f664 (diff)
downloadchef-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.rb2
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",