You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by "armando.perico.neto@usi.ch" <ar...@usi.ch> on 2012/11/28 16:43:57 UTC

Pre-commit fails when executing 'svn ls'

Hi,

I want to write a pre-commit hook which make some checks on the repository using "svn" commands. i.e.: svn ls... however, svn ls is failing to connect to localhost.

on my pre-commit file I have:
-----------------------------------------------
# I don't need the $REPOS value since this is just a test
svn ls http://localhost/svn/repo/ --username=X --password=Y --non-interactive
exit 0
-----------------------------------------------

The script works fine when I run it "manually" (even when I run it with the "apache" user)

example:
sudo -u apache env /var/www/svn/hooks/precommit (works ok)
su -s /bin/sh apache -c "/var/www/svn/hooks/precommit" (works ok)

however, when I run it with any "svn client" I get the following:
....
svn: OPTIONS of 'http://localhost/svn/repo/test.txt": could not connect to server (http://localhost)
....

I can't understand why it is failing. Would anybody have a suggestion ?


Thanks



RE: Pre-commit fails when executing 'svn ls'

Posted by "armando.perico.neto@usi.ch" <ar...@usi.ch>.
Yes, it was the SELinux messing with my life again, it works now!
(it actually saved my afternoon, I was debugging it for a loog time already)

Since this is a test//prototype environment, I've turned the SELinux it off completely (is ok for me). However, it would be nice to know how to properly allow it with the SELinux ON). 
* I will look in to it as soon as I can and post here when I have something. (if someone has already the configurations pls put them here too)

Thanks a lot for the help!


________________________________________
From: Thorsten Schöning [tschoening@am-soft.de]
Sent: 28 November 2012 16:57
To: users@subversion.apache.org
Subject: Re: Pre-commit fails when executing 'svn ls'

Guten Tag armando.perico.neto@usi.ch,
am Mittwoch, 28. November 2012 um 16:43 schrieben Sie:

> svn: OPTIONS of 'http://localhost/svn/repo/test.txt": could not
> connect to server (http://localhost)

SELInux or AppArmor may prevent communication as both work on binaries
I think, not on users, therefore your test would succeed. A lot of
people having issues like that if they try to send mails using httpd:

http://stackoverflow.com/questions/1462941/php-mail-works-from-command-line-but-not-apache/1467900#1467900

Mit freundlichen Grüßen,

Thorsten Schöning

--
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow


Re: Pre-commit fails when executing 'svn ls'

Posted by Thorsten Schöning <ts...@am-soft.de>.
Guten Tag armando.perico.neto@usi.ch,
am Mittwoch, 28. November 2012 um 16:43 schrieben Sie:

> svn: OPTIONS of 'http://localhost/svn/repo/test.txt": could not
> connect to server (http://localhost)

SELInux or AppArmor may prevent communication as both work on binaries
I think, not on users, therefore your test would succeed. A lot of
people having issues like that if they try to send mails using httpd:

http://stackoverflow.com/questions/1462941/php-mail-works-from-command-line-but-not-apache/1467900#1467900

Mit freundlichen Grüßen,

Thorsten Schöning

-- 
Thorsten Schöning       E-Mail:Thorsten.Schoening@AM-SoFT.de
AM-SoFT IT-Systeme      http://www.AM-SoFT.de/

Telefon...........05151-  9468- 55
Fax...............05151-  9468- 88
Mobil..............0178-8 9468- 04

AM-SoFT GmbH IT-Systeme, Brandenburger Str. 7c, 31789 Hameln
AG Hannover HRB 207 694 - Geschäftsführer: Andreas Muchow