From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefan Schantl To: development@lists.ipfire.org Subject: [PATCH] git: Add systemd file for git-daemon Date: Fri, 13 Jan 2017 12:52:31 +0100 Message-ID: <20170113115231.2335-1-stefan.schantl@ipfire.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2638160205512475981==" List-Id: --===============2638160205512475981== Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Add systemd unit file for a socket-based activation of git-deamon to export the git repositories. Fixes #10983. Signed-off-by: Stefan Schantl --- git/git.nm | 23 ++++++++++++++++++++++- git/systemd/git.socket | 9 +++++++++ git/systemd/git(a).service | 8 ++++++++ 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 git/systemd/git.socket create mode 100644 git/systemd/git(a).service diff --git a/git/git.nm b/git/git.nm index 13f05db..9ad9bbe 100644 --- a/git/git.nm +++ b/git/git.nm @@ -5,7 +5,7 @@ =20 name =3D git version =3D 2.6.3 -release =3D 2 +release =3D 3 =20 groups =3D Development/Tools url =3D http://git-scm.com/ @@ -114,6 +114,27 @@ packages %{gitcoredir}/git-daemon %{mandir}/man1/git-daemon* %{sharedstatedir}/git + %{unitdir}/git(a).service + %{unitdir}/git.socket + end + + script postin + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script preun + systemctl --no-reload disable git.socket >/dev/null 2>&1 || : + systemctl stop git.socket >/dev/null 2>&1 || : + systemctl stop git(a).service >/dev/null 2>&1 || : + end + + script postun + systemctl daemon-reload >/dev/null 2>&1 || : + end + + script postup + systemctl daemon-reload >/dev/null 2>&1 || : + systemctl try-restart git.socket >/dev/null 2>&1 || : end end =20 diff --git a/git/systemd/git.socket b/git/systemd/git.socket new file mode 100644 index 0000000..3dec01d --- /dev/null +++ b/git/systemd/git.socket @@ -0,0 +1,9 @@ +[Unit] +Description=3DGit Activation Socket + +[Socket] +ListenStream=3D9418 +Accept=3Dtrue + +[Install] +WantedBy=3Dsockets.target diff --git a/git/systemd/git(a).service b/git/systemd/git(a).service new file mode 100644 index 0000000..185ff25 --- /dev/null +++ b/git/systemd/git(a).service @@ -0,0 +1,8 @@ +[Unit] +Description=3DGit Repositories Server Daemon +Documentation=3Dman:git-daemon(1) + +[Service] +User=3Dnobody +ExecStart=3D-/usr/libexec/git-core/git-daemon --base-path=3D/var/lib/git --e= xport-all --user-path=3Dpublic_git --syslog --inetd --verbose +StandardInput=3Dsocket --=20 2.9.3 --===============2638160205512475981==--