chenlianxiang_Blog 2018-08-31 08:19 采纳率: 66.7%
浏览 988
已结题

linux 自定义jar 注册到服务中


[root@centos administrator]# systemctl status quote -l
● quote.service
Loaded: loaded (/etc/systemd/system/quote.service; enabled; vendor preset: disabled)
Active: failed (Result: exit-code) since 五 2018-08-31 16:16:59 CST; 25s ago
Process: 33508 ExecStart=/usr/lib/jvm/jdk1.8.0_181/bin/java -jar /work/quote.jar (code=exited, status=143)

8月 31 16:16:17 centos java[33508]: 2018-08-31 16:16:17.224 [http-nio-8089-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization started
8月 31 16:16:17 centos java[33508]: 2018-08-31 16:16:17.236 [http-nio-8089-exec-1] INFO org.springframework.web.servlet.DispatcherServlet - FrameworkServlet 'dispatcherServlet': initialization completed in 12 ms
8月 31 16:16:59 centos systemd[1]: quote.service start operation timed out. Terminating.
8月 31 16:16:59 centos java[33508]: 2018-08-31 16:16:59.462 [Thread-4] INFO o.s.b.c.e.AnnotationConfigEmbeddedWebApplicationContext - Closing org.springframework.boot.context.embedded.AnnotationConfigEmbeddedWebApplicationContext@7ab2bfe1: startup date [Fri Aug 31 16:16:05 CST 2018]; root of context hierarchy
8月 31 16:16:59 centos java[33508]: 2018-08-31 16:16:59.463 [Thread-4] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Unregistering JMX-exposed beans on shutdown
8月 31 16:16:59 centos java[33508]: 2018-08-31 16:16:59.464 [Thread-4] INFO o.s.jmx.export.annotation.AnnotationMBeanExporter - Unregistering JMX-exposed beans
8月 31 16:16:59 centos systemd[1]: quote.service: control process exited, code=exited status=143
8月 31 16:16:59 centos systemd[1]: Failed to start quote.service.
8月 31 16:16:59 centos systemd[1]: Unit quote.service entered failed state.
8月 31 16:16:59 centos systemd[1]: quote.service failed.


#!/ bin / sh
[unit]

[服务]

Type = forking
ExecStart = / usr / lib / jvm / jdk1.8.0_181 / bin / java -jar /work/quote.jar
ExecStop = / bin / kill -15 $ MAINPID
SuccessExutStatus = 200

KillMode =进程
TimeoutSet = infinty

[Install]
WantedBy = multi-user.target

jar包会启动执行,也可以在地址栏上访问,过了一会服务就直接断开了,求教

  • 写回答

1条回答 默认 最新

  • zqbnqsdsmd 2018-08-31 15:44
    关注
    评论

报告相同问题?

悬赏问题

  • ¥15 HFSS 中的 H 场图与 MATLAB 中绘制的 B1 场 部分对应不上
  • ¥15 如何在scanpy上做差异基因和通路富集?
  • ¥20 关于#硬件工程#的问题,请各位专家解答!
  • ¥15 关于#matlab#的问题:期望的系统闭环传递函数为G(s)=wn^2/s^2+2¢wn+wn^2阻尼系数¢=0.707,使系统具有较小的超调量
  • ¥15 FLUENT如何实现在堆积颗粒的上表面加载高斯热源
  • ¥30 截图中的mathematics程序转换成matlab
  • ¥15 动力学代码报错,维度不匹配
  • ¥15 Power query添加列问题
  • ¥50 Kubernetes&Fission&Eleasticsearch
  • ¥15 報錯:Person is not mapped,如何解決?