Skip to content

Commit

Permalink
Remove ubuntu 14.04 and upstart.
Browse files Browse the repository at this point in the history
  • Loading branch information
HonkingGoose committed Apr 3, 2019
1 parent 0bf5e1a commit fa5ff7a
Showing 1 changed file with 0 additions and 34 deletions.
34 changes: 0 additions & 34 deletions book/04-git-server/sections/git-daemon.asc
Original file line number Diff line number Diff line change
Expand Up @@ -52,40 +52,6 @@ Also, check that the Git binary is indeed located at `/usr/bin/git` and change t

Finally, you'll run `systemctl enable git-daemon` to automatically start the service on boot, and can start and stop the service with, respectively, `systemctl start git-daemon` and `systemctl stop git-daemon`.

Up to and including LTS 14.04, Ubuntu used upstart service unit configuration.
Therefore, on Ubuntu 14.04 or earlier, you can use an Upstart script.
So, in the following file

[source,console]
----
/etc/init/local-git-daemon.conf
----

you put this script:

[source,console]
----
start on startup
stop on shutdown
exec /usr/bin/git daemon \
--user=git --group=git \
--reuseaddr \
--base-path=/srv/git/ \
/srv/git/
respawn
----

For security reasons, it is strongly encouraged to have this daemon run as a user with read-only permissions to the repositories -- you can easily do this by creating a new user 'git-ro' and running the daemon as them.
For the sake of simplicity we'll simply run it as the same 'git' user that `git-shell` is running as.

When you restart your machine, your Git daemon will start automatically and respawn if it goes down.
To get it running without having to reboot, you can run this:

[source,console]
----
$ initctl start local-git-daemon
----

On other systems, you may want to use `xinetd`, a script in your `sysvinit` system, or something else -- as long as you get that command daemonized and watched somehow.

Next, you have to tell Git which repositories to allow unauthenticated Git server-based access to.
Expand Down

0 comments on commit fa5ff7a

Please sign in to comment.