广杰博客

  • 首页
  • IT资讯
  • IT运维
  1. 首页
  2. IT运维
  3. 正文

Installing Spring Boot Applications

10/30/2018 1482点热度 0人点赞 0条评论

systemd is the successor of the System V init system and is now being used by many modern Linux distributions. Although you can continue to use init.d scripts with systemd, it is also possible to launch Spring Boot applications by using systemd ‘service’ scripts.

Assuming that you have a Spring Boot application installed in /var/myapp, to install a Spring Boot application as a systemd service, create a script named myapp.service and place it in /etc/systemd/system directory. The following script offers an example:

[Unit]
Description=myapp
After=syslog.target

[Service]
User=myapp
ExecStart=/var/myapp/myapp.jar
SuccessExitStatus=143

[Install]
WantedBy=multi-user.target
Important
Remember to change the Description, User, and ExecStart fields for your application.
The ExecStart field does not declare the script action command, which means that the run command is used by default.

Note that, unlike when running as an init.d service, the user that runs the application, the PID file, and the console log file are managed by systemd itself and therefore must be configured by using appropriate fields in the ‘service’ script. Consult the service unit configuration man page for more details.

To flag the application to start automatically on system boot, use the following command:

$ systemctl enable myapp.service

Refer to man systemctl for more details.

标签: springboot
最后更新:05/30/2019

guangjie

这个人很懒,什么都没留下

点赞
< 上一篇
下一篇 >
最新 热点 随机
最新 热点 随机
Red Hat Enterprise Linux 9 发布,大量组件升级 windows10 家庭版添加hyper-v虚拟机组件 Red Hat Enterprise Linux 8.5 GA 发布 Rocky Linux 8.4 GA正式版发布下载 Rocky Linux 8.3 首个候选版本发布 CentOS 8.3 (2011) ISO镜像下载发布 CentOS Linux 落幕 CentOS Stream 上位 CentOS Linux 7.9 (2009) iso镜像下载 Windows 10 2020年10月更新ISO下载 ubuntu ssh通过密钥登陆服务器
hzhost独立进程设置 解决Win7下无法下载ActiveX控件问题 php无法加载zend出现Starting php_fpm Failed loading /usr/local/zend/ZendOptimizer.so centos的启动方式和语言设置 win7系统打不开chm文件 Red Hat Enterprise Linux 8.5 GA 发布 关于解决php5.2.14无法加载扩展php_curl的问题 RMS服务证书到期导致打开XPS文档出现“无法打开此受保护的文档” mdaemon的安全设置 十大必备网站服务器工具软件
标签聚合
nginx Windows Server 2012 redhat Hyper-V php_curl android springboot linux
友情链接
  • linux运维
  • 郑州SEO

COPYRIGHT © 2021 gjie.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备07002435号-8