From f25ab3a3730e876d2cf1e334ca1d59b86e17fe7f Mon Sep 17 00:00:00 2001 From: Jacob McCann Date: Mon, 11 Jan 2016 15:32:33 -0600 Subject: [PATCH] Fix systemd service enabled check --- lib/resources/service.rb | 2 +- test/unit/mock/cmd/systemctl-show-all-sshd | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/resources/service.rb b/lib/resources/service.rb index 2b205b5df..e47373c24 100644 --- a/lib/resources/service.rb +++ b/lib/resources/service.rb @@ -142,7 +142,7 @@ class Systemd < ServiceManager params['SubState'] == 'running' ? (running = true) : (running = false) # test via systemctl --quiet is-enabled # ActiveState values eg.g inactive, active - params['ActiveState'] == 'active' ? (enabled = true) : (enabled = false) + params['UnitFileState'] == 'enabled' ? (enabled = true) : (enabled = false) { name: params['Id'], diff --git a/test/unit/mock/cmd/systemctl-show-all-sshd b/test/unit/mock/cmd/systemctl-show-all-sshd index e1198fc91..4f939d025 100644 --- a/test/unit/mock/cmd/systemctl-show-all-sshd +++ b/test/unit/mock/cmd/systemctl-show-all-sshd @@ -2,5 +2,5 @@ Id=sshd.service Names=sshd.service Description=OpenSSH server daemon LoadState=loaded -ActiveState=active +UnitFileState=enabled SubState=running