-
Notifications
You must be signed in to change notification settings - Fork 2k
Update to add systemd daemon exemple #843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
systemd being the most common init system on Linux distributions, it seems logical to mention it.
There was a problem hiding this 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: |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
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"
Hi, I've just submitted a new PR with the modifications you asked. |
/etc/systemd/system/git-daemon.service | ||
---- | ||
|
||
And contain the following code. |
There was a problem hiding this comment.
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?
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. |
There was a problem hiding this comment.
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. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here too.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Updated both sentences.
systemd being the most common init system on Linux distributions, it seems logical to mention it.