广杰博客

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

Installing Spring Boot Applications

10/30/2018 1340点热度 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通过密钥登陆服务器
Red Hat Enterprise Linux 9 发布,大量组件升级windows10 家庭版添加hyper-v虚拟机组件
CentOS Linux 落幕 CentOS Stream 上位 memcached 查看所有keys命令 更改linux默认启动方式 解决An error occurred on the server when processing linux下bind域名dns服务器安装配置 Linux内核4.2正式发布 C#中如何获取数据库中表的信息和列的信息 CentOS 7.6 (1810) 正式发布 iis6的请求的资源在使用中 win7下创建扩展分区方法
标签聚合
redhat linux nginx Windows Server 2012下载 Hyper-V php_curl springboot Windows Server 2012
友情链接
  • linux运维
  • 郑州SEO

COPYRIGHT © 2021 gjie.cn. ALL RIGHTS RESERVED.

Theme Kratos Made By Seaton Jiang

豫ICP备07002435号-8