I have a shell script startup.sh
that does the following (create a RAM disk and start the teamcity agent):
#!/bin/bash
DISK=`/usr/bin/hdiutil attach -nobrowse -nomount ram://16777216`
/usr/sbin/diskutil erasevolume HFS+ "RamDiskCache" $DISK
/Users/administrator/buildAgent/bin/agent.sh start
I can run this from the command line by typing ./startup.sh
and it runs correctly. When I run from launchd, it ONLY creates the RAM disk, teamcity doesn't start.
My launchd plist is located in ~/Library/LaunchAgents
<?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.datafinch.teamcity</string>
<key>Program</key>
<string>/Users/administrator/startup.sh</string>
<key>RunAtLoad</key>
<true/>
</dict>
</plist>
What am I missing?
EDIT
Here is the agent.sh file:
https://gist.github.com/chriskooken/19f5856e3ce3c2322c53cb0afa69b057