Skip to content

Instantly share code, notes, and snippets.

@zinovyev
Created May 15, 2016 13:20
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zinovyev/5828aa70db3ba96169ddabd5d8bdd9ed to your computer and use it in GitHub Desktop.
Save zinovyev/5828aa70db3ba96169ddabd5d8bdd9ed to your computer and use it in GitHub Desktop.
/etc/systemd/system/git-daemon.service to start and enable git-daemon via systemd
[Unit]
Description=Git Repositories Server Daemon
Documentation=man:git-daemon(1)
[Service]
# Ignore non-zero exit status, access error makes git-daemon return them
ExecStart=/usr/bin/git daemon \
--user=git --group=git \
--reuseaddr \
--base-path=/opt/git/ \
/opt/git/
[Install]
WantedBy=getty.target
DefaultInstance=tty1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment