博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
把jar包部署为linux服务
阅读量:4624 次
发布时间:2019-06-09

本文共 834 字,大约阅读时间需要 2 分钟。

// 服务化1、在touch /etc/rc.d/init.d/alarmGather(创建新文件)2、vi /etc/rc.d/init.d/alarmGather(编辑文件)3、编辑内容#!/bin/bash#chkconfig: 2345 10 90#description:alarmGatherBASE_DIR="/root/wifi_alarmAks/wifi_alarmGather" JAR_FILE="wifi_alarmGather-1.1.2.9.jar"SERVICE_NAME="alarmAp5691"start()  {  echo "starting ${SERVICE_NAME}..."cd $BASE_DIRnohup java -jar $JAR_FILE >/dev/null &echo "${SERVICE_NAME} started"}  stop()  {  echo "stopping ${SERVICE_NAME}..."  pid=`ps -ef|grep $JAR_FILE |grep -v grep |awk '{print $2}'`kill -9 $pid echo "${SERVICE_NAME} stopped"}case "$1" instart)  start ;;stop)  stop ;; restart)  stop  start  ;;*) echo "Usage: `basename $0` start|stop|restart"esac exit 04、赋予权限chmod +x /etc/rc.d/init.d/alarmGather5、设置开机启动chkconfig --add alarmGather6、启动服务systemctl start alarmGather

转载于:https://www.cnblogs.com/yuanzx/p/10275237.html

你可能感兴趣的文章
apicloud UISearchBar 使用方法
查看>>
【spring+websocket的使用】
查看>>
mongo二维数组操作
查看>>
localStorage之本地储存
查看>>
Archlinux 交换左Ctrl和Cap键
查看>>
#openstack故障处理汇总
查看>>
搜索旋转排序数组 II
查看>>
20、docker swarm
查看>>
psp工具软件前景与范围文档
查看>>
day06-三元表达式
查看>>
C# DateTime.Now详细用法
查看>>
Php中"{}"大括号的用法总结(转)
查看>>
JavaScript内存优化
查看>>
BZOJ1059: [ZJOI2007]矩阵游戏(二分图匹配)
查看>>
P3385 【模板】负环
查看>>
URI、URL 和 URN的区别
查看>>
根据表达式序列(前缀、中缀、后缀)构建表达式树
查看>>
mysql性能优化
查看>>
【SqlServer系列】语法定义符号解析
查看>>
Color Length UVA - 1625
查看>>