Results 1 to 4 of 4

Thread: How to start a non-root daemon for svnserve

  1. #1
    Join Date
    Nov 2006
    Beans
    410
    Distro
    Xubuntu

    How to start a non-root daemon for svnserve

    I'm trying to set up an svn repository/server for a small group, using plain-vanilla svnserve. The svnbook recommends "create a single svn user on your system and run the server process as that user. Be sure to make the repository directory wholly owned by the svn user as well. From a security point of view, this keeps the repository data nicely siloed and protected by operating system filesystem permissions, changeable by only the Subversion server process itself." That sounds very sensible, but how is that done?

    Obviously I know how to create a user and setting the ownership and permissions to /var/svn is no problem. Starting the daemon is also simple:
    Code:
    svnserve -d
    and there's a -r option that limits access to a specific path.

    But how can I set it up so that this non-root user's daemon starts every time the system boots up, without having to manually log-in the user & run that command?

  2. #2
    Join Date
    Dec 2007
    Location
    United States
    Beans
    2,900
    Distro
    Ubuntu

    Re: How to start a non-root daemon for svnserve

    Take a look at this page:

    http://weblogs.java.net/blog/evanx/a...nd_tick_s.html

    It appears the path they took was to creat an xinetd entry to run it as a specific user. You may need to install xinetd if that is the route you want to go.

  3. #3
    Join Date
    Nov 2006
    Beans
    410
    Distro
    Xubuntu

    Re: How to start a non-root daemon for svnserve

    Thanks for that link -- it's wonderful. There were still a few stupid hurdles to get over (at first neither svnserve nor xinetd would work) but I finally figured out that

    1 - svnserve doesn't allow blank spaces at the beginning of lines in svnserve.conf, e.g. in the sample configuration file that is written in the new repository when you run "svnadmin create", on the line
    Code:
    # auth-access = write
    you have to delete not only "#" but "# ".

    and

    2 - xinetd wouldn't start svnserve when my /etc/xinetd.d/svn file was formatted as in the blog, e.g.
    Code:
    service svn {
      port = 3690
      socket_type = stream
      ...
    So I moved the "{" to the beginning of the 2nd line and deleted all leading blank spaces so it now looks like
    Code:
    service svn
    {
    port = 3690
    socket_type = stream
    ...
    After sorting out that nonsense, it seems to work perfectly.

  4. #4
    Join Date
    Dec 2007
    Location
    United States
    Beans
    2,900
    Distro
    Ubuntu

    Re: How to start a non-root daemon for svnserve

    Well done!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •