如何在 Mac OS 中的系统启动时启动 ActiveMq

Tal*_*ode 2 macos activemq-classic system startup

有没有办法在Mac OS系统启动时自动启动activemq服务器?我希望每次启动系统时它都会启动。

我试图在官方文档中查找,但没有找到。

Mar*_*ell 8

这取决于你如何安装它。

\n\n
\n\n

如果您做了明智的事情并通过homebrew安装了它,那么您可以立即启动它并在以后的所有重新启动时使用:

\n\n
brew services start activemq\n
Run Code Online (Sandbox Code Playgroud)\n\n

此信息在您安装时会显示给您activemq,但如果您忘记了它,您可以使用以下命令再次获取它(具体请参阅最后 3 行):

\n\n
brew info activemq\n
Run Code Online (Sandbox Code Playgroud)\n\n

样本输出

\n\n
activemq: stable 5.15.6\nApache ActiveMQ: powerful open source messaging server\n\nhttps://activemq.apache.org/\nNot installed\nFrom: https://github.com/Homebrew/homebrew-core/blob/master/Formula/activemq.rb\n==> Requirements\nRequired: java >= 1.7 \xe2\x9c\x94\n==> Caveats\nTo have launchd start activemq now and restart at login:\n  brew services start activemq\nOr, if you don\'t want/need a background service you can just run:\n  activemq start\n
Run Code Online (Sandbox Code Playgroud)\n\n
\n\n

如果您决定以困难的方式做事,并从源代码安装它,您将需要使用launchctl与 Apple 的launchd. 这里有一个例子。

\n