jenkins在Mac系统中默认日志、配置、启动等文件的路径

jenkins在mac系统中日志、配置、启动文件的路径与其它系统有所差异

启动、停止命令路径

开机启动配置文件位置

  1. /Library/LaunchDaemons/org.jenkins-ci.plist

启动命令所在位置

  1. /Library/Application Support/Jenkins/jenkins-runner.sh
  2. /Library/Application Support/Jenkins/Uninstall.command

停止启动jenkins

  1. sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist
  2. sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
  3. # 也可以在浏览器中以链接的方式停止、重启jenkins
  4. http://localhost:8080/exit
  5. http://localhost:8080/restart
  6. http://localhost:8080/reload

日志文件位置

  1. /var/log/jenkins/jenkins.log

配置文件路径:

  1. /etc/newsyslog.d/jenkins.conf

工作目录路径:

  1. /Users/Shared/Jenkins/

禁止开机启动

  1. launchctl unload -w /Library/LaunchDaemons/org.jenkins-ci.plist

修改jenkins默认端口

  1. #add the default parameters - this will edit /Library/Preferences/org.jenkins-ci.plist
  2. sudo defaults write /Library/Preferences/org.jenkins-ci httpPort 9090
  3. #stop
  4. sudo launchctl unload /Library/LaunchDaemons/org.jenkins-ci.plist
  5. #start
  6. sudo launchctl load /Library/LaunchDaemons/org.jenkins-ci.plist

异常及解决办法

  1. Getting `Can‘t assign requested address` java.net.SocketException using Ehcache multicast

解决上边的异常我们需要修改文件/Library/Application Support/Jenkins/jenkins-runner.sh,修改内容如下:

  1. echo /usr/bin/java $javaArgs -jar "$war" $args
  2. exec /usr/bin/java $javaArgs -jar "$war" $args
  3. 修改为:
  4. echo /usr/bin/java -Djava.net.preferIPv4Stack=true $javaArgs -jar "$war" $args
  5. exec /usr/bin/java -Djava.net.preferIPv4Stack=true $javaArgs -jar "$war" $args

构建时报错:

  1. Host deploy@xx.xx.xx.xx not found in /Users/Shared/Jenkins/.ssh/known_hosts
  2. + ssh -t -t deploy@xx.xx.xx.xx sudo service myapp stop
  3. Host key verification failed.
  4. Build step ‘Execute shell‘ marked build as failure
  5. Finished: FAILURE

解决办法:
将当前登录用户的~/.ssh目录下的id_rsa, id_rsa.pub, know_hosts拷贝到/Users/Shared/Jenkins/.ssh/目录下,并修改权限和组为jenkins:jenkins

    1. cp ~/.ssh/id_rsa /Users/Shared/Jenkins/.ssh/
    2. cp ~/.ssh/id_rsa.pub /Users/Shared/Jenkins/.ssh/
    3. cp ~/.ssh/know_hosts /Users/Shared/Jenkins/.ssh/
    4. chown -R jenkins:jenkins /Users/Shared/Jenkins/.ssh/

jenkins在Mac系统中默认日志、配置、启动等文件的路径

上一篇:Linux云


下一篇:Powershell和cmd的区别