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

Refreshing a LaunchDaemon leaves it disabled

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: PUP 3.7.5
    • Fix Version/s: PUP 3.8.3, PUP 4.2.2
    • Component/s: None
    • Labels:
      None
    • Environment:

      OS X

    • Template:
    • Story Points:
      1
    • Sprint:
      Client 2015-09-02
    • Release Notes:
      Bug Fix
    • Release Notes Summary:
      When refreshing a service on Mac OS X that was already running, it will now correctly start the service. Previously it would stop the service and fail to start it.

      Description

      If a LanchDaemon is refreshed, it will end up disabled due to the way the refresh is being run.

      Puppet runs 'launchctl unload -w' and then just 'launchctl load' when it should be running 'launchctl load -w'.

      Because it has the -w when it stops it, the service becomes disabled. The -w flag is required to reenable the service.

      Example is below.

      The current workaround is to do a refreshonly exec after the service to ensure it is actually running with a 'launchctl load -w' command.

      ```
      Info: /Stage[main]/example/File[example]: Scheduling refresh of Service[com.example.daemon]
      Debug: /Stage[main]/example/File[example]: The container Class[example] will propagate my refresh event
      Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: A restart has been triggered for the com.example.daemon service
      Debug: Stopping the com.example.daemon service
      Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: Executing 'launchctl unload -w /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: Starting the com.example.daemon service
      Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: Executing '/usr/bin/plutil -convert xml1 -o /dev/stdout /Library/LaunchDaemons/com.example.daemon.plist'
      Debug: Executing 'launchctl load /Library/LaunchDaemons/com.example.daemon.plist'
      Notice: /Stage[main]/example/Service[com.example.daemon]: Triggered 'refresh' from 1 events
      ```

        Attachments

          Issue Links

            Activity

              jsd-sla-details-panel

                People

                • Assignee:
                  qa qa
                  Reporter:
                  keeleysam Samuel Keeley
                • Votes:
                  1 Vote for this issue
                  Watchers:
                  3 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved: