[PUP-7750] puppet resource service fails on FreeBSD 11 Created: 2017/07/04  Updated: 2020/03/04  Resolved: 2020/03/04

Status: Closed
Project: Puppet
Component/s: None
Affects Version/s: PUP 4.10.0, PUP 5.0.0
Fix Version/s: None

Type: Bug Priority: Normal
Reporter: Gene Liverman Assignee: Unassigned
Resolution: Incomplete Votes: 0
Labels: cli, freebsd, help_wanted, service, type_and_provider
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

FreeBSD 11

Attachments: Text File freebsd11-bluetooth.txt     Text File freebsd11-sshd.txt    
Team: Platform OS
Method Found: Needs Assessment
QA Risk Assessment: Needs Assessment


I was playing around with FreeBSD 11 today and found that running puppet resource service failed with the error Error: Could not run: undefined method `gsub' for nil:NilClass. After doing some testing I believe it is due to Puppet not handling the results of running /etc/rc.d/bluetooth rcvar. Details and related examples below:

# note that there is not a line that says anything about enable in this service
➜  ~ service bluetooth rcvar
# bluetooth : Bluetooth setup script
➜  ~ service sshd rcvar
# sshd : Secure Shell Daemon
#   (default: "")
➜  ~ service ntpd rcvar
# ntpd : Network Time Protocol daemon
#   (default: "")
➜  ~ puppet resource service bluetooth
Error: Could not run: undefined method `gsub' for nil:NilClass

Initially I was using the version of Puppet installed by running pkg install puppet4 which brought in Puppet 4.10.0. I uninstalled that and installed the Puppet 5.0.0 gem and got the same results.

When looking in /etc/rc.d/bluetooth I noticed that rcvar= isn't set to anything whereas /etc/rc.d/sshd is set to rcvar="sshd_enable". Attached are copies of both files.

Comment by Geoff Nichols [ 2017/07/06 ]

Thank you for filing this issue. We agree it is likely an improvement, but due to other issues demanding precedence, we don’t anticipate being able to address this any time soon. If you are interested in submitting a patch to the repository for this project at https://github.com/puppetlabs, please open a pull request.

Comment by Gene Liverman [ 2017/07/06 ]

Geoff Nichols Can you point me in the direction of where in the code base to look for the code related to this?

Comment by Gene Liverman [ 2017/07/07 ]

After some guidance on where to look, it seems the offending code is likely around provider/service/freebsd.rb line 47 as there is no error handling for when there is no name. I'm planning to take a stab at fixing this in the next week or so.

Comment by Josh Cooper [ 2020/03/04 ]

I'm going to close this due to inactivity and based on Geoff's comments above. Please reopen if/when you have a PR.

Generated at Sat Aug 08 17:03:17 PDT 2020 using Jira 8.5.2#805002-sha1:a66f9354b9e12ac788984e5d84669c903a370049.