我有这个接收后挂钩
#!/bin/bash
while read oldrev newrev ref
do
# only checking out the master (or whatever branch you would like to deploy)
if [[ $ref =~ .*/master$ ]];
then
echo "Master ref received. Deploying master branch to production..."
git --work-tree=/home/prod/app --git-dir=/home/prod/chat.git/ checkout -f
killall python3 &
python3 /home/prod/app/server/server.py &
else
echo "Ref $ref successfully received. Doing nothing: only the master branch may be deployed on this server."
fi
done
运行并签出正常,但是server.py进程未启动或此后仍未运行。有什么办法可以从钩子启动python脚本,并使它保持运行状态?