Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Launchd Agents, Login Items, and Tiger



In message <email@hidden>, Mike Kobb write
s:
>I'm trying to work around the documented limitation in launchd (on  
>Tiger) that prevents it from being used to launch a process at user  
>login.  The limitation, as I understand it, is that there's no way to  
>prevent launchd from launching the process even if the user logs in  
>via a non-GUI method like ssh.

Ahh!

>So, I guess what I'm asking is if, *once I have been launched as a  
>Login Item*, I can leverage launchd to simply re-launch me properly if  
>I should crash.  Or, does a subsequent launch-on-crash suffer the same  
>basic problem that prevents launching me at login in the first place?

Hmmm.  You might be able to do something clever.

>If using launchd won't cut it, is there an alternative approach for  
>not just launching me at login, but also re-launching me if I crash?

#!/bin/sh
while true
do
	MyProgram
done

>Obviously, I don't anticipate crashing, but the project requirements  
>I've been handed specify automatic re-launching of this background  
>helper app, and I'd prefer to find a way to satisfy the requirements  
>rather than argue to have the requirement removed.

Agreed.  It makes sense -- but I don't know of a good way to do it.

>PS: "KeepAlive" is the 10.5 option.  In 10.4, it was "OnDemand", which  
>is now deprecated.

It is very sad that I should have gotten this backwards.

-s
 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-dev mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/darwin-dev/email@hidden

This email sent to email@hidden

References: 
 >Re: Launchd Agents, Login Items, and Tiger (From: Mike Kobb <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.