summaryrefslogtreecommitdiff
path: root/app-admin/puppet/files/puppet-openrc.patch
blob: 6c544eb27ae2897e231e3dd3b728db76821b041a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
If systemd is in use, OpenRC may be picked because the OpenRC provider
was underconstrained.

https://groups.google.com/g/puppet-users/c/t6vyTO0057g
--- a/lib/puppet/provider/service/openrc.rb
+++ b/lib/puppet/provider/service/openrc.rb
@@ -9,6 +9,8 @@ Puppet::Type.type(:service).provide :openrc, :parent => :base do
 
   EOT
 
+  confine :true => Puppet::FileSystem.exist?('/proc/1/comm') && Puppet::FileSystem.read('/proc/1/comm').include?('init')
+
   defaultfor 'os.name' => :gentoo
   defaultfor 'os.name' => :funtoo