diff options
author | Thom May <thom@may.lt> | 2016-08-23 18:58:57 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-23 18:58:57 +0100 |
commit | c1b5fd3537383fd05e139878487cbc251ed9f742 (patch) | |
tree | 35bfc59bd838effc82a9eb7a37a6a7cf2b0da3bc | |
parent | 0a82ddc4700bee73cf393e1b4a3ea5081a136144 (diff) | |
parent | a5e01ee189f010b5fdc4ae22c4ea1695031397d1 (diff) | |
download | chef-c1b5fd3537383fd05e139878487cbc251ed9f742.tar.gz |
Merge pull request #5210 from mal/systemd-unit-verify
Verify systemd_unit file during create
-rw-r--r-- | lib/chef/provider/systemd_unit.rb | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/lib/chef/provider/systemd_unit.rb b/lib/chef/provider/systemd_unit.rb index b96a336765..5b558ba335 100644 --- a/lib/chef/provider/systemd_unit.rb +++ b/lib/chef/provider/systemd_unit.rb @@ -193,6 +193,7 @@ class Chef f.group "root" f.mode "0644" f.content new_resource.to_ini + f.verify systemd_analyze_cmd if systemd_analyze_path end.run_action(action) end @@ -233,6 +234,14 @@ class Chef {} end end + + def systemd_analyze_cmd + @systemd_analyze_cmd ||= "#{systemd_analyze_path} verify %{path}" + end + + def systemd_analyze_path + @systemd_analyze_path ||= which("systemd-analyze") + end end end end |