subversion doesn't includes a /etc/init.d/svnserve script

Bug #58625 reported by David Gómez on 2006-09-02
60
This bug affects 10 people
Affects Status Importance Assigned to Milestone
subversion (Debian)
New
Unknown
subversion (Ubuntu)
Wishlist
Unassigned
Nominated for Lucid by Jarl

Bug Description

Binary package hint: subversion

A init script to launch subversion it's really important a should be included in the subversion package to allow to launch the subversion server in a fast way. Not everybody wants to launch their svnserver thru xinetd or apache.

On Fri, Feb 13, 2004 at 09:45:59PM +0000, Benedict Adamson wrote:
> Package: subversion
> Version: 0.37.0-2
> Severity: wishlist
> File: /usr/bin/svnserve

My expectation is that in most cases svnserve is used on conjunction
with ssh or is started via inetd. In that case no init.d script is
needed since the login session or inetd invokes svnserve. Should
there be a commented entry in /etc/inetd.conf? Would you consider
that enough? If you can describe a bit how you are using svnserve
we can probably find something that makes sense.

Thanks for the report,

-David
>
> For a serious development computer, the subversion server
> should be started on boot. That is, there should be an
> /etc/init.d script for starting svnserve
> (apache2 is already started, of, course, for those that use WebDAV).
> It would be nice if the Debian package included (at least)
> a skeleton version of that script.
>
>
> -- System Information:
> Debian Release: testing/unstable
> APT prefers unstable
> APT policy: (500, 'unstable'), (500, 'testing')
> Architecture: i386 (i686)
> Kernel: Linux 2.4.24-1-k7
> Locale: LANG=C, LC_CTYPE=C
>
> Versions of packages subversion depends on:
> ii db4.2-util 4.2.52-10 Berkeley v4.2 Database Utilities
> ii libapr0 2.0.48-4 The Apache Portable Runtime
> ii libc6 2.3.2.ds1-10 GNU C Library: Shared libraries an
> ii libdb4.2 4.2.52-9 Berkeley v4.2 Database Libraries [
> ii libexpat1 1.95.6-6 XML parsing C library - runtime li
> ii libldap2 2.1.23-1 OpenLDAP libraries
> ii libneon24 0.24.4-3 An HTTP and WebDAV client library
> ii libssl0.9.7 0.9.7c-5 SSL shared libraries
> ii libsvn0 0.37.0-2 Subversion shared libraries
> ii libxml2 2.6.5-1 GNOME XML library
> ii patch 2.5.9-1 Apply a diff file to an original
> ii zlib1g 1:1.2.1-3 compression library - runtime
>
> -- no debconf information
>
>
>

David Kimdon wrote:
...
> My expectation is that in most cases svnserve is used on conjunction
> with ssh or is started via inetd. In that case no init.d script is
> needed

I see what you mean. I didn't realise that was the intention.

..
> Should
> there be a commented entry in /etc/inetd.conf?

That would help. Perhaps an installation configuration question asking
the user whether they want svnserve to be started by inetd would be better?

> If you can describe a bit how you are using svnserve
> we can probably find something that makes sense.

I've created my own /etc/init.d/svn and /etc/default/svnserve
I could post them if you want them.
However, svnserve seems rather lightweight so far, so inetd could be
entirely adequate.

> My expectation is that in most cases svnserve is used on conjunction
> with ssh or is started via inetd

No, in the contrary, the SSH tunneling is more an option than the main
use case. Taken from the SVN website (http://subversion.tigris.org/) :

  "Subversion also offers a standalone server option using a custom
  protocol (not everyone wants to run Apache 2.x). The standalone server
  can run as an inetd service, or in daemon mode, and offers basic
  authentication and authorization. It can also be tunnelled over ssh."

> Should there be a commented entry in /etc/inetd.conf?

There should be a debconf question to invoke update-inetd.

But the package should also provide an init.d script, and debconf
questions about starting a standalone server or with inetd...

Alternatively,
le Moine Fou
--
<email address hidden>
OpenPGP 0xD9D50D8A

# Automatically generated email from bts, devscripts version 2.7.95.1
merge 253323 232584

merge 242368 259226
merge 253323 276426

--
Guilherme de S. Pastore (fatalerror)
<email address hidden>

David Gómez (davidge) wrote :

Binary package hint: subversion

A init script to launch subversion it's really important a should be included in the subversion package to allow to launch the subversion server in a fast way. Not everybody wants to launch their svnserver thru xinetd or apache.

Changed in subversion:
status: Unknown → Unconfirmed
David Solbach (d-vidsolbach) wrote :

I second that.
Just installed the subversion package and googling on how to start svnserv in (k)ubuntu led me here.
I'm used to having a /etc/init.d/svn file or similar.

Micah Cowan (micahcowan) on 2007-04-09
Changed in subversion:
status: Unconfirmed → Confirmed

Hi,

I also stumbled upon this problem. Any news since three years?
It is just unusual if Debian provides a package that contains
server features but there is not even a hint in the docs
(for instance README.Debian) how to start the server. If I
personally would maintain such a package I would even split up
the package into two (perhaps three): subversion-client and
subversion-server (perhaps subversion-common).

Kind regards

          Andreas.

--
http://fam-tille.de

Bill Robinson (airbaggins) wrote :

Yes this script is always missing from all distributions. It is quite annoying that it's never included and I believe it's quite a trivial script to include.

Michele Renda (mic-renda) wrote :

Also I think there is need of a start script, also if it will not be enabled by default when installing subversion.

Here I attach a script that can be used (It was not written by me)

Changed in subversion:
importance: Undecided → Medium
Structed (sht-alien) wrote :

@ David Solbach:

But most people DO use Apache or xinetd (afaik). It should be included in the package, but should not start automatically. or at least, the user should be noticed that an init-script has been installed (this is especially useful for users having installed the package quite often who count on not having an init-script).

David Solbach (d-vidsolbach) wrote :

Yep, Structed is right. A disabled init script would be fine. Maybe in /usr/share/doc/svn or so...

Daniel T Chen (crimsun) on 2008-09-14
Changed in subversion:
importance: Medium → Wishlist

Hi,

Any updates?

#!/bin/bash
#
# /etc/rc.d/init.d/subversion
#
# Starts the Subversion Daemon
#
# chkconfig: 2345 90 10
# description: Subversion Daemon
# processname: svnserve
# pidfile: /var/lock/subsys/svnserve

source /lib/lsb/init-functions

[ -x /usr/bin/svnserve ] || exit 1

### Default variables
SYSCONFIG="/etc/sysconfig/subversion"

### Read configuration
[ -r "$SYSCONFIG" ] && source "$SYSCONFIG"

RETVAL=0
prog="svnserve"
desc="Subversion Daemon"
pidfile="/var/run/$prog.pid"

start() {
   echo -n $"Starting $desc ($prog): "
# daemon $prog -d $OPTIONS --pid-file $pidfile
   /usr/bin/$prog -d $OPTIONS --pid-file $pidfile
   RETVAL=$?
   if [ $RETVAL -eq 0 ]; then
     touch /var/lock/subsys/$prog
   fi
   echo
}

obtainpid() {
   pidstr=`pgrep $prog`
   pidcount=`awk -v name="$pidstr" 'BEGIN{split(name,a," "); print length(a)}'`
   if [ ! -r "$pidfile" ] && [ $pidcount -ge 2 ]; then
 pid=`awk -v name="$pidstr" 'BEGIN{split(name,a," "); print a[1]}'`
 echo $prog is already running and it was not started by the init script.
   fi
}

stop() {
   echo -n $"Shutting down $desc ($prog): "
   if [ -r "$pidfile" ]; then
 pid=`cat $pidfile`
 kill -s 3 $pid
 RETVAL=$?
   else
 RETVAL=1
   fi
   [ $RETVAL -eq 0 ] && success || failure
   echo
   if [ $RETVAL -eq 0 ]; then
     rm -f /var/lock/subsys/$prog
     rm -f $pidfile
   fi
   return $RETVAL
}

restart() {
 stop
 start
}

forcestop() {
   echo -n $"Shutting down $desc ($prog): "

   kill -s 3 $pid
   RETVAL=$?
   [ $RETVAL -eq 0 ] && success || failure
   echo
   if [ $RETVAL -eq 0 ]; then
     rm -f /var/lock/subsys/$prog
     rm -f $pidfile
   fi

   return $RETVAL
}

status() {
   if [ -r "$pidfile" ]; then
 pid=`cat $pidfile`
   fi
   if [ $pid ]; then
           echo "$prog (pid $pid) is running..."
   else
        echo "$prog is stopped"
   fi
}

obtainpid

case "$1" in
  start)
   start
   ;;
  stop)
   stop
   ;;
  restart)
   restart
   RETVAL=$?
   ;;
  condrestart)
   [ -e /var/lock/subsys/$prog ] && restart
   RETVAL=$?
   ;;
  status)
   status
   ;;
  forcestop)
   forcestop
   ;;
  *)
   echo $"Usage: $0 {start|stop|forcestop|restart|condrestart|status}"
   RETVAL=1
esac

exit $RETVAL

You need to verify this script to make it perfect.

There are $OPTIONS in the start section.
I needed to put this line to make it work:

/usr/bin/$prog --daemon --pid-file $pidfile --root=/var/lib/svn/ $OPTIONS

So review this script before integration.
Maybe it should be tweaked to use standard, tunneling by ssh, with the
--tunnel option and allow read-only by direct access to the daemon
running at localhost.

found 232584 1.6.3dfsg-1
found 232584 1.6.5dfsg-1

I have written a new version of a init.d script from the skeleton
provided from Jurgen DEBO. The initscript has a LSB compliant header
and uses external options from a default configuration file
(/etc/default).

It can be easily extended for setting up a default non-start policy,
target to the medium user. I would like this script to be integrated in
newer version of the package.

--
Marco Solieri
 aka SoujaK

Jarl (jarl-dk) wrote :

The documentation (https://help.ubuntu.com/community/Subversion#Start svnserve at bootup) reccomends to use this script: http://odyniec.net/articles/ubuntu-subversion-server/svnserve

So one should expect that script to be very close to official supported script.

Jarl

Jarl (jarl-dk) wrote :

There are many comments that indicates that people would like to see this bug fixed, however, few of you have marked the bug as affecting you, please mark it as affected as this would indicate your interest.

larsen (larsen007) wrote :

Morend way is to use /etc/default/${service} file with "ENABLED=no" instead of commenting out entries in init scripts.
Initscript is missing for included svnserve component.

Igor A Tarasov (dicr) wrote :

7 years (since 2004) is not enough to create init script for package :)
good job ! :)

Ben Coleman (b-coleman) wrote :

What's holding this up?

A separate subversion-daemon package which depends on the core subversion package, and contains nothing else than the daemon script is useful for those of us who runs svnserve without Apache, and it does not stand in the way of others.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.