Just managed to get it up and running under OSX Yosemite (10.10).
First of all, I gave the user I run gerrit with all the rights on the directory that gerrit is installed to /etc/gerrit2
for me. That, and I made the $GERRIT_HOME/bin/gerrit.sh
executable. After this, you should be able to start gerrit from the user you want gerrit to run under with $GERRIT_HOME/bin/gerrit.sh start
.
Then to make it launch during system boot create a launchd plist in /Library/LaunchDaemons
(I named it com.gerrit.codereview.plist
. Make sure that it has the correct permissions sudo chown root /Library/LaunchDaemons/com.gerrit.codereview.plist
and sudo chmod -rw-r--r-- /Library/LaunchDaemons/com.gerrit.coderview.plist
.
After that, ensure that the com.gerrit.codereview.plist
looks something like this:
<?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.gerrit.codereview</string>
<key>ProgramArguments</key>
<array>
<string>$GERRIT_HOME/bin/gerrit.sh</string>
<string>start</string>
</array>
<key>RunAtLoad</key>
<true/>
<key>UserName</key>
<string>$USER_TO_RUN_GERRIT_WITH</string>
<key>WorkingDirectory</key>
<string>$GERRIT_HOME</string>
<key>StandardOutPath</key>
<string>$GERRIT_HOME/logs/error_log</string>
<key>StandardErrorPath</key>
<string>$GERRIT_HOME/logs/error_log</string>
<key>AbandonProcessGroup</key>
<true/>
</dict>
</plist>
Replace all the variables with paths that match your configuration. If you want Gerrit to run as root you can omit the Username key entirely.
Then verify that the launchd configuration works by loading it sudo launhctl load /Library/LaunchDaemons/com.gerrit.codereview.plist
and starting it sudo launchctl start com.gerrit.codereview
. After doing this gerrit should be running and accessible via its web interface.