• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
launchd's job jettison logic (Was: Re: StartupItems)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

launchd's job jettison logic (Was: Re: StartupItems)


  • Subject: launchd's job jettison logic (Was: Re: StartupItems)
  • From: Dave Zarzycki <email@hidden>
  • Date: Mon, 5 Jun 2006 09:32:20 -0700

We're planning on (but not committing to) removing the jettison logic from launchd in the Leopard timeframe.

Our internal bug tracking the mis-feature removal is: 4458207



On Jun 4, 2006, at 12:22 PM, Peter Seebach wrote:

Hmm. Well, maybe someone can tell me what I'm doing wrong with launchd.

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN"
        "http://www.apple.com/DTDs/PropertyList-1.0.dtd";>
<plist version="1.0">
<dict>
        <key>Label</key>
        <string>localhost.script_name</string>
        <key>UserName</key>
        <string>kodak</string>
        <key>ProgramArguments</key>
        <array>
                <string>/path/to/program</string>
        </array>
        <key>RunAtLoad</key>
        <true/>
</dict>
</plist>

This launchd item, placed in /Library/LaunchDaemons, never gets run.

Why?

Jun 4 12:06:18 localhost launchd: localhost.script_name: getpwnam ("kodak") failed
Jun 4 12:06:18 localhost launchd: localhost.script_name: exited with exit code: 1
Jun 4 12:06:18 localhost launchd: localhost.script_name: 9 more failures without living at least 60 seconds will cause job removal


Does the user exist? Why, yes. This is not only a user on the system, but
the user that gets automatically logged in once the system is booted.


So what happens? Launchd tries to launch this before the netinfo stuff is all
up, and ends up yanking it from the job list, not because the script or daemon
is problematic... But because the UserName key isn't viable yet.


It doesn't matter what's in the ProgramArguments, because the program never
gets to being spawned, because the UserName doesn't work.
Doesn't this mean launchd ought to, hmm. Maybe check for availability of
NetInfo before trying to spawn a job, then killing it for lack of resources?


If "don't just suicide when your resources aren't available" is such good
advice for programs in a launchd world, why doesn't launchd follow it?


-s
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Darwin-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Re: Fwd: StartupItems (From: email@hidden (Peter Seebach))

  • Prev by Date: mbuf data access
  • Next by Date: launchd bugs (Was: Re: StartupItems)
  • Previous by thread: Re: StartupItems
  • Next by thread: Re: StartupItems
  • Index(es):
    • Date
    • Thread