1. 程式人生 > >python 指令碼開機自啟動

python 指令碼開機自啟動

#!/usr/bin/env bash
#chkconfig: 2345 88 99
#description:開機自動啟動server

source /etc/profile
cd /opt/EMS/scripts/qxb_zhubei_python/server/operation
nohup python3 -B /opt/EMS/scripts/qxb_zhubei_python/server/bin/server.py &

測試指令碼如上,注意配置環境 source /etc/profile,否則報錯python3 no this file and dirctory