[Puppet - Bug #2773] buglet in provider/service/launchd.rb

0 views
Skip to first unread message

red...@puppetlabs.com

unread,
Jun 3, 2010, 12:39:27 PM6/3/10
to ja...@lovedthanlost.net, peter...@immerda.ch, r...@devco.net, d...@puppetlabs.com, er...@explosive.net, nig...@google.com, puppe...@googlegroups.com
Issue #2773 has been updated by Nigel Kersten.

Eric, you sent a patch to fix this didn't you?


Bug #2773: buglet in provider/service/launchd.rb

  • Author: eric sorenson
  • Status: Accepted
  • Priority: Normal
  • Assigned to: Nigel Kersten
  • Category: service
  • Target version: unplanned
  • Affected version: 0.25.1
  • Keywords: osx launchd
  • Branch:

I added a persistent postfix plist to replace the run-on-demand one distributed with OSX. (Which causes our nagios mailqueue check to fail annoyingly because qmgr doesn't run all the time). So upon copying the plist, process status should have been 'enabled' but 'stopped'. But it wouldn't start up by itself:

debug: Service[postfix](provider=launchd): Executing 'launchctl load /System/Library/LaunchDaemons/org.postfix.master.plist'
err: //mail::nullclient/Service[postfix]/ensure: change from stopped to running failed: Unable to start service: 
   org.postfix.master at path: /System/Library/LaunchDaemons/org.postfix.master.plist

I manually got it working with 'launchctl load -w' , but the conditional in the start() method was not being triggered. After resetting my system back to previous state and changing the check as below, I get the expected result:

debug: //mail::nullclient/Service[postfix]: Changing ensure
debug: //mail::nullclient/Service[postfix]: 1 change(s)
debug: Service[postfix](provider=launchd): Executing 'launchctl load -w /System/Library/LaunchDaemons/org.postfix.master.plist'
notice: //mail::nullclient/Service[postfix]/ensure: ensure changed 'stopped' to 'running'

So it seems 'enabled' (in puppet's view of things) but 'stopped' may still need -w to overcome a 'disabled' key in launchd's little mind. What do you think?

--- a/lib/puppet/provider/service/launchd.rb
+++ b/lib/puppet/provider/service/launchd.rb
@@ -163,7 +163,7 @@ Puppet::Type.type(:service).provide :launchd, :parent => :base do
         did_enable_job = false
         cmds = []
         cmds << :launchctl << :load
-        if self.enabled? == :false  # launchctl won't load disabled jobs
+        if self.enabled? == :false || self.status == :stopped # launchctl won't load disabled jobs
             cmds << "-w" 
             did_enable_job = true
         end

You have received this notification because you have either subscribed to it, or are involved in it. To change your notification preferences, please click here: http://projects.puppetlabs.com/my/account

red...@puppetlabs.com

unread,
Jun 8, 2010, 4:29:41 PM6/8/10
to ja...@lovedthanlost.net, peter...@immerda.ch, r...@devco.net, d...@puppetlabs.com, er...@explosive.net, nig...@google.com, puppe...@googlegroups.com
Issue #2773 has been updated by eric sorenson.

I've just been using the one-line patch inline at the problem description with no ill effects - I haven't pushed a real git commit.

tic...@puppetlabs.com

unread,
Jul 9, 2010, 12:34:23 PM7/9/10
to ja...@lovedthanlost.net, peter...@immerda.ch, r...@devco.net, d...@puppetlabs.com, da...@dasz.at, er...@explosive.net, nig...@google.com, ska...@northmontschools.com, glar...@me.com, puppe...@googlegroups.com
Issue #2773 has been updated by Gary Larizza.

Eric,

Have you seen any ill-effects out of the change in launchd.rb? I'm seeing this pop up and am wondering if you've had good luck with that fix.

tic...@puppetlabs.com

unread,
Mar 2, 2011, 12:25:02 AM3/2/11
to peter...@immerda.ch, puppe...@googlegroups.com, r...@devco.net, Ma...@puppetlabs.com, da...@dasz.at, dom...@puppetlabs.com, ja...@puppetlabs.com, nigel+...@puppetlabs.com, er...@explosive.net, ni...@puppetlabs.com, skaiser+p...@northmontschools.net, glar...@me.com
Issue #2773 has been updated by James Turnbull.
  • Status changed from Accepted to Needs design decision
  • Author: eric sorenson
  • Status: Needs design decision
  • Priority: Normal
  • Assignee: Nigel Kersten
  • Category: service
  • Target version: unplanned
  • Affected Puppet version: 0.25.1
  • Keywords: osx launchd
  • Branch:

tic...@puppetlabs.com

unread,
Aug 12, 2011, 10:02:47 AM8/12/11
to ja...@lovedthanlost.net, je...@puppetlabs.com, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, dom...@puppetlabs.com, tux...@gmail.com, er...@explosive.net, ni...@puppetlabs.com, skaiser+p...@northmontschools.net, ga...@puppetlabs.com
Issue #2773 has been updated by Nigel Kersten.
  • Status changed from Needs Decision to Tests Insufficient
  • Priority changed from Normal to High
  • Target version changed from unplanned to 2.7.x

It looks to me like we need some tests around this?

  • Author: eric sorenson
  • Status: Tests Insufficient
  • Priority: High
  • Assignee: Nigel Kersten
  • Category: service
  • Target version: 2.7.x

tic...@puppetlabs.com

unread,
Nov 7, 2011, 6:10:02 PM11/7/11
to puppe...@googlegroups.com, r...@devco.net, krzysztof....@linux.com, tux...@gmail.com, sanjiv...@gmail.com, er...@explosive.net, ga...@puppetlabs.com, skaiser+p...@northmontschools.net
Issue #2773 has been updated by James Turnbull.
  • Assignee changed from Nigel Kersten to Gary Larizza

Gary – any chance you can look at the tests for this in your copious spare time? :)

  • Author: eric sorenson
  • Status: Tests Insufficient
  • Priority: High
  • Assignee: Gary Larizza

tic...@puppetlabs.com

unread,
Nov 7, 2011, 8:04:15 PM11/7/11
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, krzysztof....@linux.com, tux...@gmail.com, sanjiv...@gmail.com, er...@explosive.net, ga...@puppetlabs.com, skaiser+p...@northmontschools.net
Issue #2773 has been updated by Gary Larizza.

Sure – thanks for the reminder on it :) I just submitted a bunch of tests to launchd, and I guess I should probably work on it while it’s fresh in my head :)

tic...@puppetlabs.com

unread,
Jan 10, 2012, 4:16:15 PM1/10/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com, er...@explosive.net, ga...@puppetlabs.com, skaiser+p...@northmontschools.net
Issue #2773 has been updated by Gary Larizza.

I updated the code and created spec tests to account for this. Eric, take a look and see if it meets the condition you’re encountering.

  • Author: eric sorenson
  • Status: Tests Insufficient
  • Priority: High
  • Assignee: Gary Larizza
  • Category: service
  • Target version: 2.7.x
  • Affected Puppet version: 0.25.1
  • Keywords: osx launchd

tic...@puppetlabs.com

unread,
Jan 10, 2012, 5:52:31 PM1/10/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com, er...@explosive.net, ga...@puppetlabs.com, skaiser+p...@northmontschools.net
Issue #2773 has been updated by Daniel Pittman.
  • Status changed from Tests Insufficient to Merged - Pending Release
  • Target version changed from 2.7.x to 2.7.10
  • Author: eric sorenson
  • Status: Merged - Pending Release
  • Priority: High
  • Assignee: Gary Larizza
  • Category: service
  • Target version: 2.7.10

tic...@puppetlabs.com

unread,
Jan 18, 2012, 6:07:11 PM1/18/12
to ja...@lovedthanlost.net, puppe...@googlegroups.com, r...@devco.net, n...@puppetlabs.com, tux...@gmail.com, sanjiv...@gmail.com, er...@explosive.net, ga...@puppetlabs.com, skaiser+p...@northmontschools.net
Issue #2773 has been updated by Michael Stahnke.
  • Status changed from Merged - Pending Release to Closed

released in 2.7.10rc1

  • Author: eric sorenson
  • Status: Closed
Reply all
Reply to author
Forward
0 new messages