Hi Marius! Thanks again! What we have done is put a script in cron to do a git pull to a repository. If pull was done successfully does nothing, else stop git-daemon and restart it:
#!/bin/bash comando=$(cd /home/git/teste_conexao_git/clone/ngit/ desenvmainline2;git pull) if [ $? -eq 0 ] ; then echo "is working" else echo "isnt working" sudo /etc/init.d/ngit-daemon stop sudo /etc/init.d/ngit-daemon start echo "git-daemon was started on $(date)" > /home/git/ teste_conexao_git/logs/git-daemon-ngit-failure.log fi PS: Inside git-daemon script, do you think if we test ( if $? is null then dont show $?.exitstatus ) could solve our problem? Best regards Renato Isidio Rio de Janeiro - Brazil On Mar 1, 11:18 am, Marius Mårnes Mathiesen <marius.mathie...@gmail.com> wrote: > On Mon, Feb 28, 2011 at 10:04 PM, Renato Isidio <renato...@gmail.com> wrote: > > Hi Marius, > > > today we saw that our git-daemon was down. The message follows: > > > /opt/gitorious/script/git-daemon:76:in `peeraddr': Transport endpoint > > is not connected - getpeername(2) (Errno::ENOTCONN) > > from /opt/gitorious/script/git-daemon:76:in `run_service' > > from /opt/gitorious/script/git-daemon:70:in `run' > > from /opt/gitorious/script/git-daemon:52:in `start' > > from /opt/gitorious/script/git-daemon:321 > > So it seems the connection is lost, and the accept_socket isn't working. > Could it be the server is on a not-so-reliable network connection? > > These things can happen, I suppose. One thing you could do is to set up some > kind of process monitoring on your server. We use Monit > (http://mmonit.com/monit/) on gitorious.org, and forcefully close services > that aren't performing as suspected. Most distros will have a Monit package, > and the defaults will usually be just fine. > > What you could do is to have Monit monitor your git daemon processes, it > will do this based on a pid file. In the Monit "recipe" you could add a > check that verifies that your git-daemon is available on the specified port > (9418); if not restart the process. It would look something like this: > > check git-daemon with pidfile /var/www/gitorious/tmp/pids/git-daemon.pid > start program = "/etc/init.d/git-daemon start" > stop program = "/etc/init.d/git-daemon stop" > if failed port 9418 then restart > > Cheers, > - Marius -- To post to this group, send email to gitorious@googlegroups.com To unsubscribe from this group, send email to gitorious+unsubscr...@googlegroups.com