首页
App
&
Coffee
文档
项目
分享
反馈
俱乐部
登录
注册
问下大家 jfinal 实现开机自启动吗?在windows和linux下
dragon688
2020-03-10 18:14
问下大家 jfinal 实现开机自启动吗?在windows和linux下
项目:
JFinal
4
1
评论区
chcode
2020-03-10 20:14
centos7.x
vim /etc/systemd/system/DataPushApp.service
输入以下内容
[Unit]
Description=数据推送服务
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart= /usr/local/apps/data-push/bin/app.sh start
ExecReload= /usr/local/apps/data-push/bin/app.sh restart
ExecStop= /usr/local/apps/data-push/bin/app.sh stop
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
设置服务开机自启动
systemctl enable DataPushApp
服务形式操作
systemctl start DataPushApp 启动
systemctl stop DataPushApp 关闭
systemctl status DataPushApp 状态
systemctl restart DataPushApp 重启
centos6.x
vim /etc/init.d/DataPushApp
输入
#!/bin/bash
#chkconfig: 345 99 99
#description:data push service
#processname:DataPushApp
export LANG="en_US.UTF-8"
case $1 in
start) sudo /usr/local/apps/data-push/app.sh start;;
stop) sudo /usr/local/apps/data-push/app.sh stop;;
*) echo "require start|stop" ;;
esac
设置服务自启动
chkconfig DathPushApp on
服务形式操作
service DataPushApp start
service DataPushApp stop
回复
chcode
2020-03-10 21:17
windows 没弄过
回复
xiuj
2020-03-10 22:41
bat放到自启动
回复
zzutligang
2020-03-11 00:21
@xiuj
bat放自动启里,只有登录windows才会执行。你可以搞一个把任意可执行文件配置成服务的一个工具软件,百度一下可以搜到。
回复
dragon688
2020-03-12 19:35
@chcode
多谢
回复
dragon688
2020-03-12 19:35
@zzutligang
好的多谢
回复
lzw0128
2020-08-04 12:55
@chcode
我遇到个问题,开机systemctl自启动报java: command not found,但是直接执行jfinal.sh start是能正常启动的
回复
chcode
2020-08-04 17:45
@lzw0128
java 命令没找到 考虑环境变量path的问题
回复
听风道长
2020-09-03 16:03
@lzw0128
我也遇到了,你解决了吗?
回复
lzw0128
2020-09-09 15:44
@听风道长
在执行文件里面重新定义环境变量JAVA_HOME=/usr/local/jdk1.8.0
export PATH=$PATH:$JAVA_HOME/bin
回复
发送
我要反馈
热门反馈
扫码入社
vim /etc/systemd/system/DataPushApp.service
输入以下内容
[Unit]
Description=数据推送服务
After=network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
ExecStart= /usr/local/apps/data-push/bin/app.sh start
ExecReload= /usr/local/apps/data-push/bin/app.sh restart
ExecStop= /usr/local/apps/data-push/bin/app.sh stop
SuccessExitStatus=143
[Install]
WantedBy=multi-user.target
设置服务开机自启动
systemctl enable DataPushApp
服务形式操作
systemctl start DataPushApp 启动
systemctl stop DataPushApp 关闭
systemctl status DataPushApp 状态
systemctl restart DataPushApp 重启
centos6.x
vim /etc/init.d/DataPushApp
输入
#!/bin/bash
#chkconfig: 345 99 99
#description:data push service
#processname:DataPushApp
export LANG="en_US.UTF-8"
case $1 in
start) sudo /usr/local/apps/data-push/app.sh start;;
stop) sudo /usr/local/apps/data-push/app.sh stop;;
*) echo "require start|stop" ;;
esac
设置服务自启动
chkconfig DathPushApp on
服务形式操作
service DataPushApp start
service DataPushApp stop