Merge branch 'stable-2.13'

* stable-2.13:
  JettyServer: Enable systemd socket activation for gerrit

Change-Id: Id28350c321bfe035d6398eda395a6d5222d267cf
This commit is contained in:
David Pursehouse
2017-03-16 20:20:59 +09:00
4 changed files with 35 additions and 1 deletions

View File

@@ -2325,6 +2325,14 @@ to permit fast restarts.
+
By default, true.
[[httpd.inheritChannel]]httpd.inheritChannel::
+
If true, permits the daemon to inherit its server socket channel
from fd0/1(stdin/stdout). When set to true, the server can be socket
activated via systemd or xinetd.
+
By default, false.
[[httpd.requestHeaderSize]]httpd.requestHeaderSize::
+
Size, in bytes, of the buffer used to parse the HTTP headers of an

View File

@@ -275,7 +275,7 @@ public class JettyServer {
} catch (URISyntaxException e) {
throw new IllegalArgumentException("Invalid httpd.listenurl " + u, e);
}
c.setInheritChannel(cfg.getBoolean("httpd", "inheritChannel", false));
c.setReuseAddress(reuseAddress);
connectors[idx] = c;
}

View File

@@ -0,0 +1,17 @@
# Systemd unit file for gerrit
[Unit]
Description=Gerrit Code Review
After=syslog.target network.target
[Service]
Type=simple
WorkingDirectory=/opt/gerritsrv/
Environment=GERRIT_HOME=/opt/gerritsrv/gerrit/ JAVA_HOME=/opt/jdk1.8.0_45/
ExecStart=/usr/bin/java -Xmx1024m -jar ${GERRIT_HOME}/bin/gerrit.war daemon -d ${GERRIT_HOME}
User=gerritsrv
SyslogIdentifier=GerritCodeReview
StandardInput=socket
[Install]
WantedBy=multi-user.target

View File

@@ -0,0 +1,9 @@
[Unit]
Description=Gerrit HTTP socket
[Socket]
ListenStream=80
Accept=no
[Install]
WantedBy=sockets.target