我正在将 bash 脚本作为 systemd 服务运行,但它给了我这个错误Failed at step EXEC spawning /home/pipeline/entity-extraction/start_consumer.sh: Permission deniedFeb 8 11:59:58 irum systemd[1]: ee-consumer.service: main process exited, code=exited, status=203/EXECFeb 8 11:59:58 irum systemd[1]: Unit ee-consumer.service entered failed state.我的 bash 脚本正在运行 2 个 Python 脚本,当我从终端以start_consumer.sh运行它时它运行良好sudo bash start_consumer.shwhile truedo echo "starting FIRST Consumer.py : $(date +"%T")" python3 /home/irum/Desktop/Marketsyc/Consumer.py & pid=$! echo "pid:$pid" sleep 60 echo "starting SECOND Consumer.py : $(date +"%T")" python3 /home/irum/Desktop/Marketsyc/Consumer.py & new_pid=$! echo "new_pid:$new_pid" # Here I want to kill FIRST Consumer.py echo "killing first consumer" kill "$pid" sleep 60 # Here I want to kill SECOND Consumer.py echo "killing second consumer" kill "$new_pid"done我的 systemd 服务ee-consumer.service 的代码[Unit]Description=Entity extraction - consumerAfter=default.target[Service]Type=simpleRestart=alwaysUser=pipelineExecStart=/home/pipeline/entity-extraction/start_consumer.sh我该如何解决这个问题?
添加回答
举报
0/150
提交
取消