티스토리 뷰
반응형
#!/bin/sh
#########################################################
# "DaemonManager.sh"
#########################################################
if [ -f ~/.bashrc ]; then
. ~/.bashrc
PATH=$PATH:$HOME/.local/bin:$HOME/bin
export PATH
export PATH=/usr/local/anaconda3-4.1.0/bin:/usr/local/lib/:$PATH
fi
WORKDIR=~/TEST/BaseUpdateDaemon
DAEMON=daemon.py
LOG=~/TEST/log/daemon.log
function do_start()
{
cd ${WORKDIR}
nohup python ${DAEMON} & >> ${LOG}
}
function do_stop()
{
PID=`ps -ef | grep ${DAEMON} | grep -v grep | awk '{print $2}'`
if [ "$PID" != "" ]; then
kill -9 $PID
fi
}
case "$1" in
start|stop)
do_${1}
;;
reload|restart)
do_stop
do_start
;;
*)
echo "Usage: ~/TEST/bin/DaemonManager\.sh {start|stop|restart}"
exit 1
;;
esac
반응형
'Devolopment > Python' 카테고리의 다른 글
PDF to TEXT by Python3 (0) | 2021.05.10 |
---|---|
STRIP TAGS AND JAVASCRIPT FROM HTML PAGE, LEAVING ONLY SAFE TAGS (PYTHON RECIPE) (0) | 2020.03.17 |
python에서 두개의 dictionary를 하나로 합치는 방법 (0) | 2020.03.16 |
PyQt5 에서 UI File 불러오는 방법 (0) | 2020.02.25 |
Python 3.x 에서 Dictionary 정렬하기 (0) | 2020.02.25 |
반응형
최근에 달린 댓글