Uploaded image for project: 'Puppet'
  1. Puppet
  2. PUP-4530

FreeBSD specific Service provider fix

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Normal
    • Resolution: Fixed
    • Affects Version/s: PUP 3.6.2, PUP 3.7.5
    • Fix Version/s: PUP 4.2.0
    • Component/s: None
    • Labels:
      None
    • Environment:

      FreeBSD sys-puppet-1.adestra.com 10.1-RELEASE-p5 FreeBSD 10.1-RELEASE-p5 #0: Tue Jan 27 08:55:07 UTC 2015 root@amd64-builder.daemonology.net:/usr/obj/usr/src/sys/GENERIC amd64

    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2015-06-10
    • Release Notes:
      Bug Fix

      Description

      The Service provider for FreeBSD parses the output of 'service foo rcvar' to work out what the service name is. However for some services – only a very few – the output contains an optional 'description' field, leading to output like this:

      % service local_unbound rcvar
      # local_unbound : local caching forwarding resolver
                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      #
      local_unbound_enable="YES"
      #   (default: "")
      
      

      leading to the creation of a file whose name has embedded spaces and other syntactically significant stuff which prevents it being loaded by the rc.conf system:

      % ls -1 /etc/rc.conf.d/ 
      local_unbound : local caching forwarding resolver
      snmpd
      

      A simple fix is to take just the leading string of non-whitespace characters
      from the first line of the rcvar output as the service name:

      % diff -u puppet-3.7.5/lib/puppet/provider/service/freebsd.rb{.orig,}
      --- puppet-3.7.5/lib/puppet/provider/service/freebsd.rb.orig    2015-03-25 16:32:47.000000000 +0000
      +++ puppet-3.7.5/lib/puppet/provider/service/freebsd.rb 2015-05-06 12:33:59.043029246 +0100
      @@ -39,7 +39,7 @@
       
         # Extract service name
         def service_name
      -    extract_value_name('service', 0, /# (.*)/, '\1')
      +    extract_value_name('service', 0, /# (\S*).*/, '\1')
         end
       
         # Extract rcvar name
      

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  Unassigned
                  Reporter:
                  adestra Matthew Seaman
                  QA Contact:
                  Eric Thompson
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  4 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: