OpenSuse服务:日志在哪里?

发布于 2025-02-05 15:43:11 字数 941 浏览 3 评论 0原文

我试图在Opensuse Leap 15上设置应用程序作为服务。 谷歌搜索搜索我发现这样做(或者我应该说“一个人可以做到”?),通过提供文件< serviceName> .service in /usr/usr/lib/systemd/system /,然后使用yast启用该服务。 我提供了这样的文件(从tomcat.service文件复制,并用与我的应用程序相关的值替换杂项条目)。

使用Yast的设置似乎可以正常工作,列出了该服务,我启用了它。但是现在我有一个问题:当我使用service< serviceName>启动应用程序时启动启动失败。使用服务< serviceName>状态我看到了一些日志的最后10行,这些日志读:

Jun 08 14:41:04 test-vm ctlscript.sh[31955]:         at java.lang.reflect.Method.invoke(Method.java:498)
Jun 08 14:41:04 test-vm ctlscript.sh[31955]:         at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
Jun 08 14:41:04 test-vm ctlscript.sh[31955]:         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:458)
...

这是一些Java stacktrace的尾巴,因此显然在启动时有一些例外。 但是,要弄清楚出了什么问题,我需要从该日志中看到更多,但是此服务命令记录到哪里?即service ... status命令来自哪个logFile?来自哪个logFile?

I am trying to set up an application as a service on OpenSUSE LEAP 15.
Googling around I found that one does that (or should I say "one can do that"?) by providing a file <servicename>.service in /usr/lib/systemd/system/ and then one enables that service using YaST.
I provided such a file (copying from a tomcat.service file already on the machine and replacing the misc. entries with values relevant for my application).

The setup using YaST seemed to have worked OK, the service was listed and I enabled it. But now I have an issue: when I start the application using service <servicename> start the startup fails. Using service <servicename> status I see the last 10 lines of some log which read:

Jun 08 14:41:04 test-vm ctlscript.sh[31955]:         at java.lang.reflect.Method.invoke(Method.java:498)
Jun 08 14:41:04 test-vm ctlscript.sh[31955]:         at org.apache.catalina.startup.Bootstrap.stopServer(Bootstrap.java:371)
Jun 08 14:41:04 test-vm ctlscript.sh[31955]:         at org.apache.catalina.startup.Bootstrap.main(Bootstrap.java:458)
...

This is the tail of some Java stacktrace, so obviously there is some exception while starting up.
But to be able to figure out what is going wrong I would need to see more from that log but where is this service command logging to? I.e. from which logfile does the above content of the service ... status command come from?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

(り薆情海 2025-02-12 15:43:11

啊 - 我终于找到了解决方案:一个人可以使用journalctl -u&lt; serviceName&gt;查看特定服务的所有日志条目。尽管这没有回答原始问题,但它是问题的根本目的,即查看特定服务的所有日志条目。

Ah - I finally found the solution: one can use journalctl -u <servicename> to see all log entries of a specific service. While that doesn't answer the original question it serves the underlying purpose of the question, namely to see all log entries for a specific service.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文