The gerrit rc.d script seems to have been broken by a recent ubuntu 22.04 update:
Jul 16 13:06:27 gerrit gerrit[919]: Starting Gerrit Code Review:
Jul 16 13:06:27 gerrit gerrit[989]: start-stop-daemon: matching only on non-root pidfile /var/gerrit/logs/gerrit.pid is insecure
Jul 16 13:06:27 gerrit systemd[1]: gerrit.service: Control process exited, code=exited, status=2/INVALIDARGUMENT
Jul 16 13:06:27 gerrit systemd[1]: gerrit.service: Failed with result 'exit-code'.
Jul 16 13:06:27 gerrit systemd[1]: Failed to start LSB: Start/stop Gerrit Code Review.
I have a more detailed log (captured when executing the script using "sh -x") if anyone is interested.
Instead of trying to fix the rc.d script, I thought I would move on from it and add a systemd unit for gerrit.
That was straightforward to do using the example gerrit.service file provided. Here is my updated version:
# Systemd unit file for gerrit
[Unit]
Description=Gerrit Code Review
After=syslog.target network.target
[Service]
Type=simple
WorkingDirectory=/var/gerrit/
Environment=GERRIT_HOME=/var/gerrit JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64
ExecStart=/usr/bin/java -Xmx1024m -jar ${GERRIT_HOME}/bin/gerrit.war daemon -d ${GERRIT_HOME}
User=gerrit
SyslogIdentifier=GerritCodeReview
#StandardInput=socket
[Install]
WantedBy=multi-user.target
I had to comment out "StandardInput=socket" to get it to work.
Can someone tell me why that line is there? I guess it is related to the other systemd example file, gerrit.socket.
Should I add a socket unit for gerrit as well?
-James M