如何在Mac Lion上启动系统时启动/停止JBoss?

如何在Mac Lion上启动系统时启动/停止JBoss?,jboss,osx-lion,Jboss,Osx Lion,我正在使用MacLion(10.7.3),我刚刚下载了JBoss7.1.0。我希望JBoss在启动机器时运行。所以我创建了这个目录 /Library/StartupItems/JBoss/ 然后在上面的目录中创建了一个名为“JBoss”的文件,其中包含 #!/bin/sh . /etc/rc.common StartService () { ConsoleMessage "Starting JBoss" $JBOSS_HOME/bin/standalone.sh }

我正在使用MacLion(10.7.3),我刚刚下载了JBoss7.1.0。我希望JBoss在启动机器时运行。所以我创建了这个目录

/Library/StartupItems/JBoss/
然后在上面的目录中创建了一个名为“JBoss”的文件,其中包含

#!/bin/sh

. /etc/rc.common

StartService () 
{
    ConsoleMessage "Starting JBoss"
    $JBOSS_HOME/bin/standalone.sh 
}

StopService () 
{
    ConsoleMessage "Stopping JBoss"
    # Don't know what to put here.  
}

RunService "$1"
如果有的话,我需要在“StopService”子句中添加什么来停止JBoss?另外,当我启动我的机器时,这是在后台运行JBoss的正确方法吗


谢谢,-Dave

在README.txt中查看,它指出:

如果服务器在后台进程中运行,则可以使用JBoss CLI停止服务器:

JBOSS_HOME>/bin/JBOSS-cli.sh--connect--command=:shutdown