[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: Berkeley DB error

From: Jakub Nadolny <jakub.nadolny_at_ite.pl>
Date: 2004-10-24 13:09:11 CEST

On Sat, Oct 23, 2004 at 12:04:02PM -0400, James FitzGibbon wrote:
> On Oct 23, 2004, at 11:55 AM, Jakub Nadolny wrote:
>
> >I have just set up Subversion and it works fine for a while, but after
> >few commits DB falls down and while trying to access SVN, I have a
> >message:
> >
> >svn: Berkeley DB error while opening environment for filesystem
> >/var/svn/dharmadhatu/db:
> >DB_RUNRECOVERY: Fatal error, run database recovery
> >
> >Then I kill svnserve, make svnadmin recover, start again svnserve and
> >everything is fine... till the next crash.
> >
> >I was trying to find out the trace what could be the problem source and
> >the only thing is that when I commit files from local network, all
> >works
> >fine, but when my friend does it from outside, then DB crashes.
>
> The umask of the webserver process is probably different from the umask
> of the local process. So if your local umask is 022 and you do
> something,
> files in the db directory get mode 0644, which prevents the web server
> from
> writing to them (even if you are in a common group).
>
> To confirm if this is the problem, look in the db directory after access
> fails from the web, note the perms, then g+w any files that have their
> group perms set to r-- or r-x and try again. If it works, that's your
> problem.
>
> Personally, I do two things to address this:
>
> 1. Run a dedicated web server for SVN with a umask of 007 (I run a
> separate
> one so that my other CGIs don't get access to the repo nor do they have
> to
> contend with the 007 umask).
>
> 2. Set up aliases for svn commands when I run them from the shell to set
> my umask to 007 for the duration of svn, svnadmin, svnrecover, etc.
>
> There is a section in the SVN book on this (I think it's called managing
> multiple repo access methods or some such).

That was a reason, thank you!

This chapter name is "Supporting Multiple Repository Access Methods" and
I've done following solution:

- wrapper scripts for svn and svserve (umask 002 before exec of
  svn/svnserve)

- set up SUID bit on repositorys DB

Files db/log.00000000* are now still owned by root, but group is set to
Apache with permission do read-write.

It works fine, once again thank you!
Jakub

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Sun Oct 24 13:09:37 2004

This is an archived mail posted to the Subversion Users mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.