Search code examples
jbossosx-lionstartuplaunchd

Anyone have a launchd script for running JBoss at boot on Mac OSX Lion?


I'm using Mac OS X Lion and just installed JBoss 7.1.0.AS. I'm having trouble getting the JBoss server to run at system startup. I created the below file (/System/Library/LaunchDaemons/jboss.plist) ...

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple$
<plist version="1.0">
<dict>
<key>Label</key>
<string>jboss</string>
<key>Disabled</key>
<false/>
<key>KeepAlive</key>
<dict>
<key>SuccessfulExit</key>
<false/>
</dict>
<key>ProgramArguments</key>
<array>
<string>sh /opt/jboss-as-7.1.0.Final/bin/standalone.sh</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>davea</string>
</dict>
</plist>

However, when I restart my computer, the server isn't running. Does anyone have a working startup script for JBoss on Mac OS X Lion or can you see what's wrong with the above?

Thanks,


Solution

  • May all future generations benefit from the sacred knowledge I'm about to throw down (thanks, Barry Margolis). The script is

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE plist PUBLIC "-//Apple Computer//DTD PLIST 1.0//EN" "http://www.apple$
    <plist version="1.0">
    <dict>
    <key>Label</key>
    <string>jboss</string>
    <key>Disabled</key>
    <false/>
    <key>KeepAlive</key>
    <dict>
    <key>SuccessfulExit</key>
    <false/>
    </dict>
    <key>Program</key>
    <string>/opt/jboss-as-7.1.0.Final/bin/standalone.sh</string>
    <key>StandardOutPath</key>
    <string>/Users/davea/out.log</string>
    <key>RunAtLoad</key>
    <true/>
    <key>UserName</key>
    <string>davea</string>
    </dict>
    </plist>
    

    Make sure the script is registered with 644 perms using root:wheel owner and group. Rock on, - Dave