You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@subversion.apache.org by Graham Anderson <gr...@siren.cc> on 2006/07/27 05:43:38 UTC

svn: Can't open file '/home/www/socalgraph-dev/.svn/lock': Permission denied

I can run my post-commit script successfully as root...but not as  
user svn

The post-commit  script executes an 'svn update' on a website on the  
server
As I am running subversion as user, 'svn' , how do I grant 'svn'  
privileges to run the script ?

This is the script:
#!/bin/bash
/home/svn/repository/hooks/update-dev


This is the compiled 'c' script:
#include <stdlib.h>
           int main(int argc, const char *argv[])
           {
             system("/usr/local/bin/svn  update /home/mysite-dev/www");
           }


The 'post-commit' script and update-dev are owned by user , 'svn'
-rwsr-sr-x    1 svn      svn            50 Jul 25 20:06 post-commit
-rwsr-sr-x    1 svn      svn         13789 Jul 27 00:22 update-dev



'svn'  is a member of  the correct group, mysite-devgrp

$ pico /etc/group
mysite-devgrp:x:501:mysite-dev,svn
$  pwd
/home/mysite-dev/www
$ groups
users mysite-devgrp


any help is appreciated as I am new to unix

many thanks
g



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn: Can't open file '/home/www/socalgraph-dev/.svn/lock': Permission denied

Posted by Graham Anderson <gr...@siren.cc>.
thanks :)
now my post-commit script is working

g


On Jul 27, 2006, at 2:57 AM, Ryan Schmidt wrote:

> On Jul 27, 2006, at 07:43, Graham Anderson wrote:
>
>> I can run my post-commit script successfully as root...but not as  
>> user svn
>>
>> The post-commit  script executes an 'svn update' on a website on  
>> the server
>> As I am running subversion as user, 'svn' , how do I grant 'svn'  
>> privileges to run the script ?
>
> From the error message, it sounds like it's not complaining about  
> being unable to run the script -- it's saying it can't write to  
> parts of the working copy you're updating. Is that working copy  
> owned by svn? Likely at least parts of it are now owned by root, if  
> you ran the update command as root as you say you did. So you  
> should fix the ownership of the working copy so it's entirely owned  
> by your svn user:
>
> sudo chown -R svn /home/mysite-dev/www
>
> or
>
> sudo chown -R svn /home/www/socalgraph-dev
>
> whatever the path is.
>
> Then, never run the update script using any user other than your  
> svn user, or you'll have to do the above all over again.
>
>
>> This is the script:
>> #!/bin/bash
>> /home/svn/repository/hooks/update-dev
>>
>>
>> This is the compiled 'c' script:
>> #include <stdlib.h>
>>           int main(int argc, const char *argv[])
>>           {
>>             system("/usr/local/bin/svn  update /home/mysite-dev/ 
>> www");
>>           }
>>
>>
>> The 'post-commit' script and update-dev are owned by user , 'svn'
>> -rwsr-sr-x    1 svn      svn            50 Jul 25 20:06 post-commit
>> -rwsr-sr-x    1 svn      svn         13789 Jul 27 00:22 update-dev
>>
>>
>>
>> 'svn'  is a member of  the correct group, mysite-devgrp
>>
>> $ pico /etc/group
>> mysite-devgrp:x:501:mysite-dev,svn
>> $  pwd
>> /home/mysite-dev/www
>> $ groups
>> users mysite-devgrp
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org

Re: svn: Can't open file '/home/www/socalgraph-dev/.svn/lock': Permission denied

Posted by Ryan Schmidt <su...@ryandesign.com>.
On Jul 27, 2006, at 07:43, Graham Anderson wrote:

> I can run my post-commit script successfully as root...but not as  
> user svn
>
> The post-commit  script executes an 'svn update' on a website on  
> the server
> As I am running subversion as user, 'svn' , how do I grant 'svn'  
> privileges to run the script ?

 From the error message, it sounds like it's not complaining about  
being unable to run the script -- it's saying it can't write to parts  
of the working copy you're updating. Is that working copy owned by  
svn? Likely at least parts of it are now owned by root, if you ran  
the update command as root as you say you did. So you should fix the  
ownership of the working copy so it's entirely owned by your svn user:

sudo chown -R svn /home/mysite-dev/www

or

sudo chown -R svn /home/www/socalgraph-dev

whatever the path is.

Then, never run the update script using any user other than your svn  
user, or you'll have to do the above all over again.


> This is the script:
> #!/bin/bash
> /home/svn/repository/hooks/update-dev
>
>
> This is the compiled 'c' script:
> #include <stdlib.h>
>           int main(int argc, const char *argv[])
>           {
>             system("/usr/local/bin/svn  update /home/mysite-dev/www");
>           }
>
>
> The 'post-commit' script and update-dev are owned by user , 'svn'
> -rwsr-sr-x    1 svn      svn            50 Jul 25 20:06 post-commit
> -rwsr-sr-x    1 svn      svn         13789 Jul 27 00:22 update-dev
>
>
>
> 'svn'  is a member of  the correct group, mysite-devgrp
>
> $ pico /etc/group
> mysite-devgrp:x:501:mysite-dev,svn
> $  pwd
> /home/mysite-dev/www
> $ groups
> users mysite-devgrp


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org