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

Re: Setting up svnserve on Linux/Ubuntu

From: Ximon Eighteen <ximon.eighteen_at_int.greenpeace.org>
Date: 2005-09-27 10:03:52 CEST

Gregory Piņero wrote:
> Hi guys,
>
> I made a repository on my new Ubuntu computer, and I started the svnservee
> daemon by running:
>
> $ svnserve -d -r /myrepo/
>
> And everything works great, but now I want this daemon to be started
> whenever the computer is started and to be "respawned" if the process
> ever dies? How I would I go about doing this? (I'm new to linux)

Four ideas (maybe three and a half):-

1. Add a script in /etc/init.d/ and use chkconfig to enable it.
2. Use a tool like DaemonTools. (http://cr.yp.to/daemontools.html)
3. Use inittab.
4. For a simple user space solution maybe you could just use a KDE
startup script or something? (not applicable to a server).

1) will allow your computer to start svnserve when the computer starts
(more technically it starts svnserve in the runlevels you specify).

2)+3) can give you "respawning".

2) requires root access to modify the inittab line, and root access if
you ever want to actually stop (i.e. not stop and restart) svnserve.

3) requires root just once to run DaemonTools then afterwards
DaemonTools command line commands can be run by any user.

A modification of 3) is to use a script to do the work on inittab for
you in a safe way and make that executable by non root users. This is
the process I use.

Quick inittab primer:

inittab is the configuration file read by the init process (see man
inittab and man init for much more). You can add a line like this to
inittab:-

   svn:2345:respawn:/path/to/svnserve -d -r /myrepo/

And tell init that its' file has changed:-

   telinit q (or just init q)

Now init will launch (if you are in runlevel 2, 3, 4 or 5) your command
(svnserve) and if it dies it will relaunch it. If your command starts
and dies too quickly init will throttle it (it will stop attempting to
run it for five minutes).

To stop svnserve completely edit the line by prefixing it with a # and
run telinit q again. Init will stop svnserve (sig TERM followed by sig
KILL if needs be).

Ximon

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Received on Tue Sep 27 10:06:54 2005

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.