|
|
Mac 10.4: Launchd Problem
|
|
|
|
Fresh-Faced Recruit
Join Date: Feb 2008
Status:
Offline
|
|
Hi,
I am trying to run more than one programs through single .plist using launchd.
I don't know how to put program arguments. I have tried for that but not getting results. I am new user of Mac 10.4
My .plist format is:
<?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>com.domain.Agent</string>
<key>OnDemand</key>
<false/>
<key>ProgramArguments</key>
<array>
<string>/usr/local/prgram1</string>
<string>/usr/local/prgram2</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>StandardErrorPath</key>
<string>/Library/Logs/Prg.log</string>
<key>StandardOutPath</key>
<string>/Library/Logs/Prg.log</string>
</dict>
</plist>
Plz help on this..
Thanks,
Pankaj.
|
|
|
|
|
|
|
|
|
Senior User
Join Date: Dec 2002
Status:
Offline
|
|
First let me say that I have no real knowledge of setting up launchd items but had to Google this a while back to get a CVS pserver running. Maybe this example will shine some light on your issue: AFP548 - CVS pserver launchd item for OS X 10.4
The first things I notice from glancing between yours and his is that you don't specify a Program or Username key/value. Also, might have to include the program name as the first child in the ProgramArguments array.
<?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>com.apple.cvspserver</string>
<key>UserName</key>
<string>cvs</string>
<key>Program</key>
<string>/usr/bin/cvs</string>
<key>ProgramArguments</key>
<array>
<string>cvs</string>
<string>-f</string>
<string>--allow-root=/Users/cvs</string>
<string>pserver</string>
</array>
<key>Sockets</key>
<dict>
<key>Listeners</key>
<dict>
<key>SockPassive</key>
<true/>
<key>SockServiceName</key>
<string>cvspserver</string>
<key>SockType</key>
<string>SOCK_STREAM</string>
</dict>
</dict>
<key>inetdCompatibility</key>
<dict>
<key>Wait</key>
<false/>
</dict>
</dict>
</plist>
|
Travis Sanderson
|
|
|
|
|
|
|
|
Junior Member
Join Date: Mar 2000
Location: Salem, OR, USA
Status:
Offline
|
|
I wouldn't call myself an expert on this since I have only been poking around launchd a few days. I've been reading up on launchd this week for a project at work.
I don't think you can launch two executables with one plist. The way you have it now it will run as if the path to program2 is a parameter to program1.
It looks like you just want these programs to run at startup (or login, depending on which Library folder you put the plist in). I see two options.
1) Make a shell script that runs these two programs. Make the shell script the target of your plist.
2) Make two plists.
Let us know if you find a third option.
-numero
|
|
|
|
|
|
|
|
|
Fresh-Faced Recruit
Join Date: Feb 2008
Status:
Offline
|
|
Thanks to u both for reply..
I am also trying for third option but not getting it.
Currently I solved it by making two .plist and one shell script.
Pankaj
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Forum Rules
|
|
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
|
|
|
|
|
|