plist 用于在 Mac 上启动时自动启动 tomcat
我想使用 Mac mini 作为服务器。所以我已经安装了tomcat,并且希望它在启动时自动启动。 在 Windows 上,这称为“服务”。 我是 Mac OS 新手,但我读到这是 /Library/LaunchDaemon 文件夹中的 plist 文件。
所以我找到了以下链接: https://gist.github.com/661713 我复制了文件并插入了正确的路径。
但是当我尝试启动时 launchctl load /Library/LaunchDaemons/org.apache.tomcat.plist
我收到以下错误:
launchctl:没有返回 plist:/Library/LaunchDaemons/org.apache.tomcat.plist launchctl:没有返回 plist:/Library/LaunchDaemons/org.apache.tomcat.plist 找不到要加载的内容
I want to use a Mac mini as a server. So I've installed tomcat and I want it to start automatically when booting.
On Windows this is called a "services".
I'm new to Mac OS but I read that this is a plist file in the /Library/LaunchDaemon folder.
So I found following link: https://gist.github.com/661713
I copied the files and inserted the correct paths.
But when I try to launchlaunchctl load /Library/LaunchDaemons/org.apache.tomcat.plist
I get the following errors:launchctl: no plist was returned for: /Library/LaunchDaemons/org.apache.tomcat.plist
launchctl: no plist was returned for: /Library/LaunchDaemons/org.apache.tomcat.plist
nothing found to load
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我发现我对 Mac 完全陌生。因此,更改文件的扩展名并不意味着更改文件类型:)
我用 textedit 编写了 plist,但它不是一个“真正的”plist。因此,我使用属性列表编辑器创建了一个 plist,错误消失了。
I noticed I'm completely new to Mac. So changing the extension name of a file doesn't really mean to change the filetype :)
I wrote the plist with textedit, but it wasn't a "true" plist. So I created a plist with the property list editor and the error disappeared.
阻止启动的非法字符通常是缩进空格。使用nano重新编辑文件,并删除空格并使用Tab重新缩进。这解决了我的问题。
The illegal characters that stop this launching are usually the spaces for indentation. Re-edit the file with nano, and remove spaces and reindent with Tab. That fixed the problem for me.