[launchd-dev] ~/LaunchAgent + KeepAlive=true = Login Jail

James Bucanek subscriber at gloaming.com
Sun Jan 27 22:16:25 PST 2008

Nathan Duran <mailto:launchd at khiltd.com> wrote (Friday, January 
25, 2008 11:32 AM -0800):

>On Jan 25, 2008, at 10:21 AM, James Bucanek wrote:
>>Anyway, is there a workaround for this or do I just have to 
>>abandon KeepAlive?
>Why not have your application unload the launchd job when it receives the shutdown event?

The more I think about this, the more it appears that this is 
really no different than just leaving out the KeepAlive property.

The only difference is that KeepAlive would restart my 
background app if it crashed. Fortunately (through the brilliant 
programming efforts of its creator, I'm sure), this particular 
app simply doesn't crash -- knock on wood.

What I really wanted is the ability to restart the app simply by 
asking it to quit, or restarting the app if the user quit it.

Since my app can't tell the difference between a Quit for a 
Shutdown and a Quit just for the sake of quitting, I think I'll 
have to give up on the KeepAlive flag for this version.

James Bucanek

More information about the launchd-dev mailing list