ITPub博客

首页 > IT职业 > IT职场 > Linux后台运行

Linux后台运行

IT职场 作者:nt1979 时间:2021-09-09 10:47:43 0 删除 编辑

如果打完的包是在linux的  /develop/mall

在 /etc/systemd/system建立一个文件mall.service

#### /etc/systemd/system/mall.service

图片描述

然后写入:


[Unit]

Description=mall

After=syslog.target

[Service]

User=root

ExecStart=/usr/bin/java -jar -Dspring.profiles.active=prod -Dlogging.path=/develop/logs /develop/mall.jar


[Install]

WantedBy=multi-user.target



要注意的事情,如果运行不了,那么拷贝出

/usr/bin/java -jar -Dspring.profiles.active=prod /develop/mall.jar

这个命令在前台运行,看报什么错

https://blog.csdn.net/hchhan/article/details/81106404?utm_medium=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param&depth_1-utm_source=distribute.pc_relevant_t0.none-task-blog-BlogCommendFromMachineLearnPai2-1.channel_param

通过ps -ef|grep java看是否启动成功


来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/4822/viewspace-2826215/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-08-05

  • 博文量
    318
  • 访问量
    17316