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 ...
随机推荐
- 拖动层 拖动div 封装js 貌似不兼容FF,郁闷
原文发布时间为:2009-12-02 -- 来源于本人的百度文章 [由搬家工具导入] <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Tran ...
- AVRStudio 6 添加调试功能
下载这个文件并安装就可以了:http://avr-jungo-usb.software.informer.com/download/ 具体可以看这个贴子:http://electronics.stac ...
- 手机横屏时候提示请竖屏浏览纯css实现
//今天无意间浏览nike公众号看到的 最近也正在做着就记录下来备忘<!DOCTYPE html> <html lang="en"> <head> ...
- vue-cli脚手架每行注释
.babelrc文件 { // 此项指明,转码的规则 "presets": [ // env项是借助插件babel-preset-env,下面这个配置说的是babel对es6,es ...
- linux下解压zip文件
linux下解压zip文件 linux自带的unzip命令可以解压windows下的zip格式的压缩文件. unzip命令 语法:unzip [选项] 压缩文件名.zip 各选项的含义分别为: -x ...
- Ubuntu FireFox的“后退”按钮与Backspace键
我们都知道,大部分的网页浏览器和窗口管理器的“后退”按钮是和Backspace键关联的,这样会极大的方便并加快我们浏览时的翻页速度(我一直是左手 放在键盘上按快捷键,右手鼠标的姿势找文件和看网页的,省 ...
- java模拟一次简单的sql注入
在数据库中生成 一个用户表 有用户名 username 和密码password 字段 并插入两组数据 正常的sql查询结果 非正常查询途径返回的结果 下面用一段java代码 演示一下用户登录时的sq ...
- poj 1061(线性同余)
青蛙的约会 Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 104278 Accepted: 20356 Descript ...
- LeetCode OJ-- Add Binary
https://oj.leetcode.com/problems/add-binary/ 对两个二进制字符串求和. 对于字符串 ans_str,求它的翻转. reverse(ans_str.begin ...
- Python Challenge 第十五关
第15关,题目是 whom? 有一张图片,是个日历.日历的年份是 1XX6,中间是被挖去的洞.然后图中1月26日被画了个圈,当天是星期一.右下角的二月小图中有29号,可以得知这是闰年.然后查看源代码. ...