mirror of
https://github.com/Stichting-MINIX-Research-Foundation/pkgsrc-ng.git
synced 2025-08-04 02:08:49 -04:00
27 lines
1.3 KiB
Plaintext
27 lines
1.3 KiB
Plaintext
$NetBSD: patch-ab,v 1.6 2015/08/17 13:20:43 fhajny Exp $
|
|
|
|
Make the FreeBSD provider the default for NetBSD as well.
|
|
Omit _enabled for init scripts under NetBSD, which doesn't look for them.
|
|
|
|
--- lib/puppet/provider/service/freebsd.rb.orig 2015-08-14 08:28:22.488080198 +0000
|
|
+++ lib/puppet/provider/service/freebsd.rb
|
|
@@ -3,7 +3,7 @@ Puppet::Type.type(:service).provide :fre
|
|
desc "Provider for FreeBSD and DragonFly BSD. Uses the `rcvar` argument of init scripts and parses/edits rc files."
|
|
|
|
confine :operatingsystem => [:freebsd, :dragonfly]
|
|
- defaultfor :operatingsystem => [:freebsd, :dragonfly]
|
|
+ defaultfor :operatingsystem => [:freebsd, :netbsd, :dragonfly]
|
|
|
|
def rcconf() '/etc/rc.conf' end
|
|
def rcconf_local() '/etc/rc.conf.local' end
|
|
@@ -86,6 +86,9 @@ Puppet::Type.type(:service).provide :fre
|
|
# Add a new setting to the rc files
|
|
def rc_add(service, rcvar, yesno)
|
|
append = "\# Added by Puppet\n#{rcvar}_enable=\"#{yesno}\"\n"
|
|
+ if Facter.value(:operatingsystem) == "NetBSD"
|
|
+ append = "\# Added by Puppet\n#{rcvar}=\"#{yesno}\"\n"
|
|
+ end
|
|
# First, try the one-file-per-service style
|
|
if Puppet::FileSystem.exist?(rcconf_dir)
|
|
File.open(rcconf_dir + "/#{service}", File::WRONLY | File::APPEND | File::CREAT, 0644) {
|