I'm trying to set up a local LaunchAgent for cassandra and am running into an issue since bin/cassandra
is just a shell script that launches:
/usr/bin/java -ea -javaagent:blah blah blah blah blah blah blah
My LaunchAgent launches the script but either never launches cassandra or doesn't allow it to spawn sub-processes, or, well I'm not entirely sure what's happening but it seems I've run into this issue before. The only way I know of to get this to work is to change my LaunchAgent from:
<?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.cassandra.agent</string>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>UserName</key>
<string>root</string>
<key>ProgramArguments</key>
<array>
<string>/path/to/cassandra/bin/cassandra</string>
</array>
<key>WorkingDirectory</key>
<string>/path/to/cassandra/bin</string>
</dict>
</plist>
to...
...
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-ea</string>
<string>-javaagent:blah</string>
<string>blah</string>
<string>blah</string>
<string>blah</string>
<string>blah</string>
<string>blah</string>
<string>blah</string>
</array>
I'm wondering if anyone knows how I can just reference the shell script from the LaunchAgent instead of pulling all the args from ps aux