我正在尝试使用以下命令在 mac mini 上启动 jenkins slave/Library/LaunchDaemons/com.jenkins.ci.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>Label</key>
<string>com.jenkins.ci</string>
<key>UserName</key>
<string>jenkins</string>
<key>SessionCreate</key>
<true/>
<key>ProgramArguments</key>
<array>
<string>/usr/bin/java</string>
<string>-Djava.awt.headless=true</string>
<string>-jar</string>
<string>/Users/jenkins/agent.jar</string>
<string>-jnlpUrl</string>
<string>http://jenkins2.domain.net:8080/computer/jenkins-mac/slave-agent.jnlp</string>
<string>-secret</string>
<string>23erft6yhujnhyujnbftyujbvcdrtyhbvcxswedaw</string>
<string>-workDir</string>
<string>"/Users/jenkins/jenkins_slave/"</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
<key>StandardErrorPath</key>
<string>/Users/jenkins/error.log</string>
<key>StandardOutPath</key>
<string>/Users/jenkins/stdout.log</string>
</dict>
</plist>
然后
sudo launchctl load /Library/LaunchDaemons/com.jenkins.ci.plist
但在/Users/jenkins/error.log
我懂了
Exception in thread "main" java.io.IOException: The specified working directory should be fully accessible to the remoting executable (RWX): "/Users/jenkins/jenkins_slave/"
at org.jenkinsci.remoting.engine.WorkDirManager.verifyDirectory(WorkDirManager.java:249)
at org.jenkinsci.remoting.engine.WorkDirManager.initializeWorkDir(WorkDirManager.java:202)
at hudson.remoting.Launcher.run(Launcher.java:300)
at hudson.remoting.Launcher.main(Launcher.java:283)
我已经打开了/Users/jenkins/jenkins_slave/
仍然777
收到此错误。
jenkins2-slave3:~ jenkins$ ls -ld /Users/jenkins/jenkins_slave/
drwxrwxrwx 5 jenkins jenkins 160 Nov 13 2018 /Users/jenkins/jenkins_slave/
jenkins2-slave3:~ jenkins$ ls -ld /Users/jenkins/
drwxr-xr-x+ 44 jenkins staff 1408 Jun 5 10:12 /Users/jenkins/
如果我以用户身份在 mac 上运行以下jenkins
操作,它可以工作
/usr/bin/java -Djava.awt.headless=true -jar /Users/jenkins/agent.jar -jnlpUrl http://jenkins2.domain.net:8080/computer/jenkins-mac/slave-agent.jnlp -secret 23erft6yhujnhyujnbftyujbvcdrtyhbvcxswedaw -workDir "/Users/jenkins/jenkins_slave/"
有人知道这里有什么问题吗?
系统软件概述:
System Version: macOS 10.14.4 (18E226)
Kernel Version: Darwin 18.5.0
Boot Volume: Macintosh HD
Boot Mode: Normal
Computer Name: jenkins-slave
User Name: jenkins (jenkins)
Secure Virtual Memory: Enabled
System Integrity Protection: Enabled
Time since boot: 7 days 23:11