Skip to content

Conversation

Buzut
Copy link
Contributor

@Buzut Buzut commented Oct 5, 2017

systemd being the most common init system on Linux distributions, it seems logical to mention it.

systemd being the most common init system on Linux distributions, it seems logical to mention it.
Copy link
Member

@ben ben left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In addition to the specific comments below, could you keep to the convention of having one sentence per line of text? It helps with diffing when changes are proposed. Thanks!

You can daemonize this process a number of ways, depending on the operating system you're running.
On an Ubuntu machine, you can use an Upstart script.

systemd being the most common init system among modern Linux distributions (Debian, Ubuntu, RHEL, CentOS…), you can use systemd for that purpose. Your systemd file should be places as follows:
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's make this a bit more prosey:

Since `systemd` is the most common init system among modern Linux distributions, you can use it for that purpose.
Simply place a file in `/etc/systemd/system/git-daemon.service` with these contents:


You might have noticed that Git daemon is started here with `git` as both group and user. Modify it to fit your needs. Make sure provided user exists on the system.

Finally, you'll run `systemctl enable git-daemon` to automatically start the service on boot, and usual service commands like `service start` and `service stop` are instantly avoilable.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"and the usual service commands"

@Buzut
Copy link
Contributor Author

Buzut commented Oct 6, 2017

Hi,

I've just submitted a new PR with the modifications you asked.

/etc/systemd/system/git-daemon.service
----

And contain the following code.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well now lines 26-32 don't make sense. Could you remove them?

@Buzut
Copy link
Contributor Author

Buzut commented Oct 7, 2017

Oops haden't seen this. Fixed!

WantedBy=multi-user.target
----

You might have noticed that Git daemon is started here with `git` as both group and user. Modify it to fit your needs. Make sure provided user exists on the system.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Whoops, looks like we have multiple sentences on a single line here. It really helps diff readability to format with each sentence on its own line.


Finally, you'll run `systemctl enable git-daemon` to automatically start the service on boot, and the usual service commands like `service start` and `service stop` are instantly available.

Until LTS 14.04, Ubuntu used upstart service unit configuration. Therefore, on Ubuntu <= 14.04 you can use an Upstart script.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here too.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated both sentences.

@ben ben merged commit 3094824 into progit:master Oct 7, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants