-
Task
-
Resolution: Unresolved
-
Major
-
None
Hello
When I run pipeline with sh to kill a process on linux server, but when I run "ps -ef | grep XXX" this process it is still there.
Could you help to guide me how to make it work please?
For example: node('my_linux_server'){ stage('Stop Jenkins'){ echo "Stop Jenkins Server " + env.JENKINS_SERVER_NAME sh 'kill `pgrep -f ${JENKINS_SERVER_NAME}`' sh 'ps -ef | grep -v grep | grep $JENKINS_SERVER_NAME' } }
actually, the process is doesn't exsit when run "kill `pgrep -f ${JENKINS_SERVER_NAME}`", the second command "ps -ef | grep -v grep | grep $JENKINS_SERVER_NAME" shouldn't return any thing, but it did.
So could you help to have a look it if it is a issue or something wrong with my commands please?