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.
Jenkins--Run shell command in jenkins as root user?的更多相关文章
- ubuntu服务器上提示 To run a command as administrator (user "root"), use "sudo <command>". See " 解决方案
原因是你执行命令必须要在root用户下执行.其他用户权限不够.运行 sudo -s 切换到root用户下就可以了
- Run Shell Commands in Python
subprocess.call This is the recommended way to run shell commands in Python compared with old-fashio ...
- Jenkins可用环境变量列表以及环境变量的使用(Shell/Command/Maven/Ant)
一.可用环境变量列表(以下来自google翻译): BRANCH_NAME 对于多分支项目,这将被设置为正在构建的分支的名称,例如,如果您希望从而master不是从特征分支部署到生产. CHANGE_ ...
- 以root用户运行jenkins中shell命令 重要
以centOS系统为例,记录下修改Jenkins以root用户运行的方法. 修改Jenkins配置文件 # 打开配置文件vim /etc/sysconfig/jenkins# 修改$JENKINS_U ...
- 写个shell脚本搭载jenkins让你的程序部署飞起来
[转载请注明]: 原文出处:https://www.cnblogs.com/jstarseven/p/11399251.html 作者:jstarseven 码字挺辛苦的..... 说明 ...
- jenkins执行shell提示命令不存在
问题描述: jenkins编译项目,不继承linux环境变量 ~/.bash_profile ~/.bashrc /etc/profile,导致在执行shell脚本,提示命令找不到! [sz-hg ...
- Dockerfile 构建前端nginx应用并用shell脚本实现jenkins自动构建
Dockerfile 文件构建docker镜像 FROM centos MAINTAINER zh********h.cn RUN rm -f /etc/nginx/nginx.conf COPY n ...
- Jenkins在shell脚本运行docker权限报错解决
报错环境 系统信息 Distributor ID: Ubuntu Description: Ubuntu 16.04.1 LTS Release: 16.04 Codename: xenial doc ...
- Dockerfile 构建后端springboot应用并用shell脚本实现jenkins自动构建
Dockerfile 文件构建docker镜像 FROM centos MAINTAINER zh*****eng "z*******ch.cn" ENV LANG en_US.U ...
随机推荐
- springBoot 数组增加工具类包
1.pom中加入依赖 <!--数组工具类 start--> <dependency> <groupId>org.apache.commons</groupId ...
- 将Map<String, List<Map<String,Object>>>进行排序
首先我贴上我的代码,刚开始我也不知道怎么排序还写了一些方法,最后请教群里的大神解决了 public Map<String, List<Map<String,Object>> ...
- UVA 725 division【暴力枚举】
[题意]:输入正整数n,用0~9这10个数字不重复组成两个五位数abcde和fghij,使得abcde/fghij的商为n,按顺序输出所有结果.如果没有找到则输出“There are no solut ...
- [TJOI2014] 上升子序列
刚刚做的时候一看:这不是个傻逼题吗hhhhh....然后发现写完了过不了样例,仔细一看题:同构的算一种. 这可咋办啊? 其实很简单,设f[i] 为 以a[i] 结尾的上升子序列个数,我们考虑当前如果算 ...
- Java线程池原理解读
引言 引用自<阿里巴巴JAVA开发手册> [强制]线程资源必须通过线程池提供,不允许在应用中自行显式创建线程. 说明:使用线程池的好处是减少在创建和销毁线程上所消耗的时间以及系统资源的开销 ...
- Java NIO中的FileLock(文件锁)
FileLock,文件锁. 文件锁在OS中很常见,如果多个程序同时访问.修改同一个文件,很容易因为文件数据不同步而出现问题.给文件加一个锁,同一时间,只能有一个程序修改此文件,或者程序都只能读此文件, ...
- Jsp2.0自定义标签(第三天)——EL表达式的使用
1.提出问题: 我们经常会看到这样的jsp页面代码: 浏览器显示: 为什么会在页面输出:Hello World ,${per}究竟是如何找到“Hello World”的呢? 2.分析问题: 要想解决 ...
- 我希望早几年知道的5个Unix命令
使用*nix系统已经有一段时间了.但还是有一些命令是被我一直忽略的,真希望我能早几年发现这些命令. 1. man ascii 这个命令会打印出八进制.十六进制和十进制的ASCII码表.难以置信我是一个 ...
- Android常用URI收藏
转:http://www.android-study.com/jichuzhishi/338.html 以下是常用到的Intent的URI及其示例,包含了大部分应用中用到的共用Intent 一.打开一 ...
- Python中xml、字典、json、类四种数据的转换
最近学python,觉得python很强很大很强大,写一个学习随笔,当作留念注:xml.字典.json.类四种数据的转换,从左到右依次转换,即xml要转换为类时,先将xml转换为字典,再将字典转换为j ...