zoukankan      html  css  js  c++  java
  • Jenkins--Run shell command in jenkins as root user?

    You need to modify the permission for jenkins user so that you can run the shell commands. You can install the jenkins as as service (download the rpm package), You might need to change the ports because by default it runs http on 8080 and AJP on 8009 port. 

    Following process is for CentOS
    1. Open up the this script (using VIM or other editor):

    vim /etc/sysconfig/jenkins
    

    2. Find this $JENKINS_USER and change to “root”:

    $JENKINS_USER="root"
    

    3. Then change the ownership of Jenkins home, webroot and logs:

    chown -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:

    service jenkins restart
    ps -ef | grep jenkins
    

    Now you should be able to run the Jenkins jobs as the root user and all the shell command will be executed as root.

  • 相关阅读:
    docker 命令(我使用过的)
    docker 概述
    RabbitMq 概述
    spring cloud gateway
    redis-集群(codis和Cluster)
    jdbc 简单示例和优缺点
    git
    Mycat--概述
    线程池
    同步容器和并发容器
  • 原文地址:https://www.cnblogs.com/melody-emma/p/6026622.html
Copyright © 2011-2022 走看看