Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Apparently my server is running CentOS 4.8 with Cpanel

uname -a
2.6.9-023stab048.6-enterprise #1 SMP  MSK 2008 i686 i686 i386 GNU/Linux

cat /etc/redhat-release
CentOS release 4.8 (Final)

I'd prefer to install it as a service but I cannot seem to install "yum git-daemon" there is no package available for CentOS 4.8 (when I try to include another repos for it I get too many dependency failures)

So what's the easiest way to just start it? Typically this is how I do it from CLI

git daemon --detach --user=git --group=git

Thanks for any help!

share|improve this question

Either copy over the /etc/init.d/ssh file to /etc/init.d/git, and change the ssh commands to git, or find an existing init script for git and install it.

Here's an example:

Then do this:

chkconfig add git

For more info, see the man page for chkconfig(8).

share|improve this answer

The URL mentioned in dmarti's response has changed. The working link is:

The script seems to work ok with CentOS 6.2. Two changes were needed:

  • entered the correct base-path
  • provided the fully qualified path for the git-daemon as /usr/libexec/git-core/git-daemon was not in PATH
share|improve this answer

I've seen that script and another but they are based on Centos5 which has the proper yum repos for git-daemon and that package can make and install only under 5.x

So their script fails on my centos4 and I get this:

service git-daemon start
Starting git-daemon: execvp: No such file or directory

because git-daemon doesn't exist

But your idea to start with the ssh script is excellent, I didn't know which one I could mimic and that's a good one.

share|improve this answer

A hopefully helpful note to others in the future who are trying to install git and/or git-daemon on a Centos 4 or 5 server that is running cpanel

cpanel is preventing these backages from installing via yum because perl* is specifically excluded from any yum updates

temporarily remove perl* from /etc/yum.conf then you can install then put perl* back in there

share|improve this answer

You must log in to answer this question.