Reputation: 183
I have installed Jenkins on a Mac mini running Sierra using Homebrew but whenever I restart the computer I am unable to connect to it from another computer on the same LAN. I have to manually run the command jenkins in terminal to launch it & then it works. I followed various tutorials about LaunchDaemons & my plist file is present in that folder. I am not a Mac expert so can someone please guide me step by step? I just want to have it up & running automatically whenever the system reboots.
Upvotes: 0
Views: 1454
Reputation: 1
Create this file: /Library/LaunchDaemons/com.jenkins.plist
cd /Library/LaunchDaemons
touch com.jenkins.plist
sudo touch com.jenkins.plist
chmod go+wx com.jenkins.plist
Add the below to the file:
<?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</string>
<key>ProgramArguments</key>
<array>
<string>/usr/local/bin/java</string>
<string>-jar</string>
<string>/opt/homebrew/opt/jenkins-lts/libexec/jenkins.war</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>KeepAlive</key>
<true/>
</dict>
</plist>
chmod go-wx com.jenkins.plist
launchctl list | grep jenkins
after reboot as intended.NOTE: This location changes so verify the jenkins.war is located there: /opt/homebrew/opt/jenkins-lts/libexec/jenkins.war
Upvotes: 0
Reputation: 183
Got the answer after much brain-wracking.
Upvotes: 0