Add systemd unit file for a socket-based activation
of git-deamon to export the git repositories.
Fixes #10983.
Signed-off-by: Stefan Schantl <stefan.schantl@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
name = git
version = 2.6.3
-release = 2
+release = 3
groups = Development/Tools
url = http://git-scm.com/
%{gitcoredir}/git-daemon
%{mandir}/man1/git-daemon*
%{sharedstatedir}/git
+ %{unitdir}/git@.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@.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
--- /dev/null
+[Unit]
+Description=Git Activation Socket
+
+[Socket]
+ListenStream=9418
+Accept=true
+
+[Install]
+WantedBy=sockets.target
--- /dev/null
+[Unit]
+Description=Git Repositories Server Daemon
+Documentation=man:git-daemon(1)
+
+[Service]
+User=nobody
+ExecStart=-/usr/libexec/git-core/git-daemon --base-path=/var/lib/git --export-all --user-path=public_git --syslog --inetd --verbose
+StandardInput=socket