|
|
#1 |
|
Prospect
Join Date: Jan 2012
Posts: 3
|
OSX Lion: Launchd VMware script stops unwanted
Hi all, I am new on the forum, but definitely not on OSX and Unix. Still i have an persistent issue.
I wrote a start script, in this case for VMware. Runs perfectly when hit from commandline: The script starts VMware, then the script exits and VMware keeps running. Basically, this is the shell script, mark the backticks: `/Applications/VMware\ Fusion.app/Contents/Library/vmware-vmx -x /Users/pietje/Virtual\ Machines/Ubuntu\ 64-bit.vmwarevm/Ubuntu\ 64-bit.vmx >> $logFile 2>&1 &` The following script will make Launchd start VMWARE, and also keep it running, but now the bash script will remain running. `/Applications/VMware\ Fusion.app/Contents/Library/vmware-vmx -x /Users/pietje/Virtual\ Machines/Ubuntu\ 64-bit.vmwarevm/Ubuntu\ 64-bit.vmx & >> $logFile 2>&1` But when calling with launchdaemon, the script runs, starts VMware. When the bash script ends however, VMware gets terminated too. Here is my plist: <?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>Label</key> <string>com.pietje.launch.vmware</string> <key>ProgramArguments</key> <array> <string>/Users/pietje/bin/bash/com.pietje.launch.vmware.plist.sh</string> <string>LaunchDeamon</string> </array> <key>RunAtLoad</key> <true/> <key>LaunchOnlyOnce</key> <true/> </dict> </plist> I have tried all kinds of stuff. also nohup, but that will not work too, gives nohup: can't detach from console: Inappropriate ioctl for device Also <key>KeepAlive</key> <true/> does not work Any guru here who can help me? |
|
|
|
|
|
#2 |
|
Site Admin
Join Date: Jan 2002
Location: Montreal
Posts: 31,941
|
Why are you using backticks in your script? Backticks are used to capture the output of a command - that doesn't seem relevant here.
__________________
hayne.net/macosx.html |
|
|
|
|
|
#3 |
|
Hall of Famer
Join Date: Apr 2002
Posts: 3,315
|
This may be one of those cases where it's better to employ launchd directly, instead of having it call upon a script. E.g. this should work:
Code:
: : <key>ProgramArguments</key> <array> <string>/Applications/VMware Fusion.app/Contents/Library/vmware-vmx</string> <string>-x</string> <string>/Users/pietje/Virtual Machines/Ubuntu 64-bit.vmwarevm/Ubuntu 64-bit.vmx</string> </array> : : NB: as can be seen in my (code fragment) version, we should not escape\ spaces or add any "quoting" in the plist... since those <string> fields get quoted when read by launchd. NB2: since we aren't relying on any script process to act as our middleman, there's no need for that backgrounding (&) business. Also, I left out the >> $logFile 2>&1 part... since we don't know the actual path there.
__________________
chown -R us /your\ base/ -HI- . Last edited by Hal Itosis; 01-27-2012 at 01:31 PM. |
|
|
|
|
|
#4 |
|
Prospect
Join Date: Jan 2012
Posts: 3
|
Without bakticks teh script does not run well.
@ Hal Itosis: your posting seems the best hint so far, got it also from a friend of mine. Thanks especially for the remarks (the two NB's) because I am sure those will save me two or more hours! :-) I keep u posted on the results. |
|
|
|
![]() |
| Tags |
| launchd bash vmware lion |
| Thread Tools | |
| Display Modes | Rate This Thread |
|
|