[launchd-dev] Working with overrides.plist
Damien Sorresso
dsorresso at apple.com
Thu Sep 3 11:06:49 PDT 2009
On Sep 3, 2009, at 10:37 AM, Dean Shavit wrote:
> On Sep 3, 2009, at 12:30 PM, Damien Sorresso wrote:
>
>> On Sep 3, 2009, at 9:53 AM, Dean Shavit wrote:
>>> OK,
>>>
>>> I think I figured it out.
>>>
>>> Here's what I found:
>>>
>>> so if you're going to be using the override for a launchagent with
>>> specified SessionTypes, you need to specify a different session
>>> type - so:
>>>
>>> sudo launchctl unload -w -S LoginWindow /Library/LaunchAgents/
>>> com.most.vnc.plist
>>>
>>> That sets Disabled to true in the overrides.plist
>>>
>>> However, in Leopard, launchctl allowed specifying *any*
>>> sessiontype in the plist to write the Disabled key
>>>
>>> so:
>>>
>>> sudo launchctl unload -w -S Aqua /Library/LaunchAgents/
>>> com.most.vnc.plist
>>>
>>> had the same result. However, in Snow Leopard, it generates an
>>> error. This change was not documented, as far as I can tell. Does
>>> anyone think this requires a bug report?
>>
>>
>> You must specify a session when you manipulate any job which has
>> the LimitLoadToSessionType property set. If the session type you
>> specify isn't one of the elements in LimitLoadToSession type, then
>> launchctl won't do anything.
>
> I am aware of that. But there's differences in behavior. In Leopard,
> specifying any Session Type listed in the LaunchAgent using "sudo"
> worked to write the Disable key in the plist targeted. In Snow
> Leopard, this behavior does not hold true for the overrides.plist
>
>>
>>
>> There is nothing tying modifying the overrides database to the
>> session type you specify.
>
> OK, but evidently the Session Type specified has an impact on
> whether the launchctl command can successfully modify overrides.plist!
>
>> If you've noticed a pattern, it's a result of the underlying
>> implementation.
>
> I suppose, but I would've hoped for some documentation in that area.
> I guess a bug report is a bit late. Hope this helps someone else.
I misread your previous email. Are you saying that, for a job that is
LimitLoadToSessionType { LoginWindow }, you must specify a non-
LoginWindow session to disable or enable it? If so, this sounds like
bad behavior, and you should file a bug.
--
Damien Sorresso
BSD Engineering
Apple Inc.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 2425 bytes
Desc: not available
URL: <http://lists.macosforge.org/pipermail/launchd-dev/attachments/20090903/74033851/attachment-0001.bin>
More information about the launchd-dev
mailing list