Skip to content

Commit 27957cf

Browse files
author
Ciprian Badescu
committed
(maint) disable debian service provider if systemd is running with PID 1
When we deliver both systemd and systemv init scripts, sometimes puppet decides to use debian provider on `puppet resource service puppet` commands, even when system is running with systemd. The change confines debian provider to systems where `systemd` is not running with PID 1 and is complementary to the confine from systemd provider
1 parent 3884b28 commit 27957cf

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

lib/puppet/provider/service/debian.rb

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@
1717
commands :invoke_rc => "/usr/sbin/invoke-rc.d"
1818
commands :service => "/usr/sbin/service"
1919

20+
confine :false => Puppet::FileSystem.exist?('/proc/1/comm') && Puppet::FileSystem.read('/proc/1/comm').include?('systemd')
21+
2022
defaultfor :operatingsystem => :cumuluslinux, :operatingsystemmajrelease => ['1','2']
2123
defaultfor :operatingsystem => :debian, :operatingsystemmajrelease => ['5','6','7']
2224
defaultfor :operatingsystem => :devuan

0 commit comments

Comments
 (0)