当我想要做一些需要sudo privelegies的东西时,构建过程会停滞不前,而且ps aux对于那个命令来说,它会挂在列表中但什么都不做.
例如:
在buildscript中:
# stop nginx
echo "INFO: stopping nginx. pid [$(cat /opt/nginx/logs/nginx.pid)]"
sudo kill $(cat /opt/nginx/logs/nginx.pid)
Run Code Online (Sandbox Code Playgroud)
在gitlab ci输出控制台中:
INFO: stopping nginx. pid [2741]
kill $(cat /opt/nginx/logs/nginx.pid) # with a spinning wheel
Run Code Online (Sandbox Code Playgroud)
在bash中:
> ps aux | grep nginx
root 6698 0.0 0.1 37628 1264 ? Ss 19:25 0:00 nginx: master process /opt/nginx/sbin/nginx
nobody 6700 0.3 0.3 41776 3832 ? S 19:25 0:00 nginx: worker process
kai 7015 0.0 0.0 4176 580 pts/0 S+ 19:27 0:00 …Run Code Online (Sandbox Code Playgroud)