[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: svn, subversion, repos



peter@easthope.ca wrote:
> http://svnbook.red-bean.com/en/1.7/svn.reposadmin.create.html has 
> 
> $ # Create a repository
> $ svnadmin create /var/svn/repos
> $
> 
> In wheezy this fails of course.  Is /var writeable by users in 
> any widely used Linux?

That is simply an example.  If you use the example with a different
directory path then it will work fine.

  $ mkdir -p ~/svn
  $ svnadmin create ~/svn/myrepository

> peter@dalton:/var$ svnadmin create svn/repos
> svnadmin: Repository creation failed
> svnadmin: Could not create top-level directory
> svnadmin: Can't create directory 'svn/repos': No such file or directory

Here "No such file or directory" indicates that /var/svn does not
exist.  Regardless of anything else you would need to make that
directory first.  And having made that directory you would need to
decide upon how you are going to control access to it.  You might be
fine using it as your own personal only directory.

I don't like putting version control repositories under /var.  There
has been a long standing practice to place them under /srv.  I always
place storage for services such as this under /srv.

  $ su -
  Password:
  # mkdir /srv/svn
  # chown peter:peter /srv/svn
  # exit
  $ svnadmin create /srv/svn/myrepository

Or if working with a small group on a shared machine then create a
shared group for all parties to use.

  # su -
  # addgroup mysharedgroup
  # adduser peter mysharedgroup
  # exit
  $ exit
  login: peter
  $ id | grep --color mysharedgroup
  $ svnadmin create /srv/svn/myrepository

Groups are only assigned at login time.  Must log in to have new
groups assigned to your process.  Okay to use 'su' to stack another
shell.

  # su -
  # addgroup mysharedgroup
  # adduser peter mysharedgroup
  # adduser paul mysharedgroup
  # adduser mary mysharedgroup
  # exit
  $ exec su peter
  Password:
  $ id | grep --color mysharedgroup

The above sets up the shared group for working within a small group
using the technique known as UPG (user private groups).  To set up the
shared work area set the set-group-id bit on the directory.

  # mkdir /srv/svn
  # chgrp mysharedgroup /srv/svn
  # chmod g+ws /srv/svn

Then a member of the group can create the repository.

  $ svnadmin create /srv/svn/myrepository

> No mention of repos in /usr/share/doc/subversion/README.Debian.
> Nothing obvious in wiki.debian.org.
> Nothing in https://www.debian.org/doc/packaging-manuals/fhs/fhs-2.3.html.
>
> Is there a "common practise" in Debian?  Write permission on /var? 
> repos in /home/user/?

The choice of location is completely up to you.  What color do you
paint your bike shed?  Why isn't the bike shed color choice
documented?

I don't like putting version control repositories under /var.  There
has been a long standing practice to place them under /srv.  I always
place storage for services such as this under /srv.  I always put my
web html document root under /srv for the same reason.  But the choice
is yours.

Bob

Attachment: signature.asc
Description: Digital signature


Reply to: