在Jenkins中运行shell脚本经常遇到权限问题,解决起来也是比较烦神的事情,最后我生气了,索性来个终极解决办法,就是给jenkins一个root权限
1). vim /etc/sysconfig/jenkins
2). Find this $JENKINS_USER and change to “root”:1
$JENKINS_USER="root"
3). Then change the ownership of Jenkins home, webroot and logs:1
2
3chown -R root:root /var/lib/jenins
chown -R root:root /var/cache/jenkins
chown -R root:root /var/log/jenkins
4). Restart Jenkins and check the user has been changed:1
service jenkins restart