Jenkins fails to start jar through shell

There are many methods mentioned on the Internet, but none of them work. It may be a problem with the jenkins version, but the details are not clear.

  1. Check environment variable settings: Make sure the environment variables are set correctly when starting Jenkins BUILD_ID=DONTKILLME. -DYou can set environment variables by adding options to the Jenkins startup script or command line , for example:

    java -jar jenkins.war -DBUILD_ID=DONTKILLME

    ----invalid

  2. Check operating system permissions: On some operating systems, administrator or superuser privileges are required to set and pass environment variables. Make sure you have sufficient privileges to set BUILD_ID=DONTKILLMEenvironment variables. ---invalid

  3. Restart the Jenkins service: After applying new environment variable settings or modifying the configuration, restart the Jenkins service to ensure the changes take effect. ----invalid

  4. Before executing the .sh file, add  BUILD_ID=dontKillMe. invalid

Final solution:

source /etc/profile
export JENKINS_NODE_COOKIE=dontKillMe

---efficient

Guess you like

Origin blog.csdn.net/bobocqu/article/details/131149801