[PUP-7750] puppet resource service fails on FreeBSD 11 Created: 2017/07/04  Updated: 2018/05/21

Status: Accepted
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: Unresolved Votes: 0
Labels: cli, freebsd, help_wanted, service, type_and_provider
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

FreeBSD 11


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

 Description   

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
#
sshd_enable="YES"
#   (default: "")
 
➜  ~ service ntpd rcvar
# ntpd : Network Time Protocol daemon
#
ntpd_enable="NO"
#   (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.



 Comments   
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.

Generated at Mon Oct 21 07:47:33 PDT 2019 using JIRA 7.7.1#77002-sha1:e75ca93d5574d9409c0630b81c894d9065296414.