[launchd-dev] 10.4 & 10.5 Launch Agent compatibility
Steffan A. Cline
steffan at hldns.com
Tue Feb 17 14:27:40 PST 2009
on 2/16/09 5:31 PM, Steffan Cline at steffan at hldns.com wrote:
> on 2/16/09 4:51 PM, Steffan Cline at steffan at hldns.com wrote:
>
>> I've been working on a solution to some issues with getting
>> OpenOffice.org.app to work in a headless state but there is some issue with
>> the build that prevents this.
>>
>> So, as a work around I am trying to come up with a LaunchAgent that will
>> load OpenOffice.org on boot and run consistently. It seems I have no choice
>> to use LoginWindow and Aqua to keep it up regardless of whether or not a
>> user is logged in. On 10.4.11 no matter what I do, it does not load at boot.
>> I have to manually load it with
>> launchctl load /Library/LaunchAgents/net.execuchoice.doc-converter.plist
>> Obviously this is not practical. On 10.5.x it loads as expected on boot.
>>
>> My questions are:
>> 1) Am I doing something wrong in the following file?
>>
>> 2) Is there something I can do to get this to work universally for both
>> platforms? (10.4 & 10.5)
>>
>> 3) Is there a way to have this launch regardless of the LoginWindow or Aqua
>> session type rather than have an instance close and relaunch?
>>
>> <?xml version="1.0" encoding="UTF-8"?>
>> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
>> "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
>> <plist version="1.0">
>> <dict>
>> <key>KeepAlive</key>
>> <true/>
>> <key>OnDemand</key>
>> <false/>
>> <key>RunAtLoad</key>
>> <true/>
>> <key>Label</key>
>> <string>net.execuchoice.doc-converter</string>
>> <key>LimitLoadToSessionType</key>
>> <array>
>> <string>LoginWindow</string>
>> <string>Aqua</string>
>> </array>
>> <key>ProgramArguments</key>
>> <array>
>>
>> <string>/Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin</string>
>> <string>-headless</string>
>> <string>-nologo</string>
>> <string>-nofirststartwizard</string>
>> <string>-invisible</string>
>> <string>-accept="socket,host=127.0.0.1,port=8100;urp;"</string>
>> </array>
>> <key>StandardErrorPath</key>
>> <string>/Library/Logs/OpenOfficeDaemon.log</string>
>> <key>StandardOutPath</key>
>> <string>/Library/Logs/OpenOfficeDaemon.log</string>
>> </dict>
>> </plist>
>>
>>
>> Thanks
>>
>> Steffan
>>
>
> I noticed something else too. The application does not listen on port 8100
> as one might think. When I do a ps -ax | grep soffice I see the following:
>
> 565 ?? Rs 19:12.79
> /Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin -headless
> -nologo -nofirststartwizard -invisible
> -accept="socket,host=127.0.0.1,port=8100;urp;"
>
> This leads me to believe it's up. In actuality, it is not listening. I am
> not sure why but if I manually execute this:
>
> /Applications/OpenOffice.org.app/Contents/MacOS/soffice.bin -headless
> -nologo -nofirststartwizard -invisible
> -accept="socket,host=127.0.0.1,port=8100;urp;" &
>
> I am then able to connect to the service. What is the dealio? Is there some
> key I am missing?
>
>
> Thanks
>
> Steffan
>
Well, once the launchagent is working, it will restart as expected in the
event of a crash. I wonder if a startup item is a fair work around to get
the launchagent working?
I'll have to look for a good example of a startup script for the
launchagent. :-) LOL.
Thanks
Steffan
---------------------------------------------------------------
T E L 6 0 2 . 7 9 3 . 0 0 1 4 | F A X 6 0 2 . 9 7 1 . 1 6 9 4
Steffan A. Cline
Steffan at ExecuChoice.net Phoenix, Az
http://www.ExecuChoice.net USA
AIM : SteffanC ICQ : 57234309
YAHOO : Steffan_Cline MSN : steffan at hldns.com
GOOGLE: Steffan.Cline Lasso Partner Alliance Member
---------------------------------------------------------------
More information about the launchd-dev
mailing list