首页 > 其他 > 详细

Centos7 启动脚本

时间:2019-04-25 10:02:44      阅读:141      评论:0      收藏:0      [点我收藏+]

Centos7 启动脚本

启动脚本、如果进程已存在,输出错误信息后退出;

#! /bin/bash

PIDS=`ps -ef | grep /usr/bin/node ./index.js | grep ? | awk {print $2}`
if [ -n "$PIDS" ]; then
   echo "ERROR: The index.js (user async service) already started!"
   echo "PID: $PIDS"
   exit 1
fi

echo start index.js ...
cd /myservice
./nohup index.js 2>&1>/dev/null &

sleep 3

str=$"\n"
sstr=$(echo -e $str)
echo $sstr
echo "start index.js success"

 

Centos7 启动脚本

原文:https://www.cnblogs.com/bruceleeliya/p/10766567.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!