#232584 /usr/bin/svnserve: Need an init.d script?

Package:
subversion
Source:
subversion
Description:
Advanced version control system
Submitter:
Benedict Adamson
Date:
2021-04-21 15:09:03 UTC
Severity:
wishlist
#232584#5
Date:
2004-02-13 21:45:59 UTC
From:
To:
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.

#232584#10
Date:
2004-02-14 12:53:17 UTC
From:
To:
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,

#232584#15
Date:
2004-02-14 14:28:56 UTC
From:
To:
David Kimdon wrote:
...

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

...

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

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.

#232584#20
Date:
2004-04-03 14:49:18 UTC
From:
To:
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."

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

#232584#29
Date:
2007-05-07 07:39:56 UTC
From:
To:
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.

#232584#34
Date:
2008-12-28 13:42:50 UTC
From:
To:
Hi,

Any updates?

#232584#39
Date:
2009-02-19 20:49:58 UTC
From:
To:
#!/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

#232584#44
Date:
2009-02-19 20:59:50 UTC
From:
To:

#232584#49
Date:
2009-02-19 21:38:44 UTC
From:
To:
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.

#232584#58
Date:
2009-11-27 16:04:12 UTC
From:
To:
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.

#232584#63
Date:
2010-06-21 10:59:19 UTC
From:
To:
The documentation now at
http://svnbook.red-bean.com/nightly/en/svn-book.html#svn.serverconfig.choosing.recommendations
recommends against SSH tunnelling, saying:

"In general, the authors of this book recommend a vanilla svnserve
installation for small teams just trying to get started with a Subversion
server; it's the simplest to set up and has the fewest maintenance issues."

It goes on to recommend using svnserve with SASL if encryption is required,
instead of tunnelling with SSH which is "effectively the same as local users
accessing via file://", which in turn is strongly discouraged.

Roger

#232584#68
Date:
2010-10-10 08:31:31 UTC
From:
To:
Thank you to both you and Jurgen for providing this.

However the script doesn't work with dash in Lenny, giving the following errors:

/etc/init.d/subversion: 21: source: not found
/etc/init.d/subversion: 24: source: not found
/etc/init.d/subversion: 47: Syntax error: "(" unexpected (expecting "}")

I have worked around this by telling it to use bash instead of sh.

Roger

#232584#73
Date:
2012-03-24 21:33:14 UTC
From:
To:
Hi,

Share my svnserve init.d script.

First, I use user "svn" and group "svn" for svnserve:

[ "`getent group svn`" ] || addgroup --system svn

[ "`getent passwd svn`" ] || adduser --system --home /srv/svn \
    --shell /bin/false --ingroup svn --disabled-password \
    --disabled-login --gecos "svnserver server account" svn

Some file paths embedded in /etc/init.d/svnserve and can be adjusted in
/etc/default/svnserve:
repository root: /srv/svn
pid file:  /var/run/svnserve.pid
log file: /var/log/svnserve.log
config file: /srv/svn/svnserve.conf  (I used --config-file option
because I wouldn't like to manage */conf/svnserve.conf)

Files attached, hope that's useful for somebody:-)
/etc/init.d/svnserve
/etc/default/svnserve
/etc/logrotate.d/svnserve

The  /etc/init.d/svnserve is modified from /etc/init.d/skeleton.

Regards,
Yubao Liu

#232584#78
Date:
2012-03-24 21:40:18 UTC
From:
To:
Sorry, forgot "delaycompress" below the "compress" line in
/etc/logrotate.d/svnserve,
because svnserve doesn't handle SIGHUP signal to reopen log file.

Regards,
Yubao Liu

#232584#83
Date:
2012-04-09 02:01:41 UTC
From:
To:
Is it just be, or is this a glaring omission?

First reported in 2004 as well.

I see contributions have been made, but why hasn't it been incorporated?

#232584#88
Date:
2016-01-06 01:37:13 UTC
From:
To:
Thank you for the script, which I have been successfully using for several
years.

I've just upgraded to Jessie and svnserve now appears to require write
access to the directory containing the PID file. Also PID files have moved
to /run. I have therefore modified the script to create /run/svnserve with
owner svn:svn and moved the PID file to /run/svnserve/svnserve.pid

Roger

#232584#93
Date:
2016-04-20 05:14:18 UTC
From:
To:
My name Tabitha contact me urgently now so that i can tell you more details about me
#232584#98
Date:
2016-12-17 06:49:48 UTC
From:
To:
Dear Customer,

We can not deliver your parcel arrived at December 16.

You can find more details in this e-mail attachment!

Thanks,
Terrence Shaffer,
Operation Manager.

#232584#103
Date:
2016-12-24 05:01:35 UTC
From:
To:
Dear Customer,

Your item has arrived at the FedEx Post Office at December 23, but the courier was unable to deliver parcel to you.

You can download the shipment label attached!

With anticipation,
Troy Brock,
Support Clerk.

#232584#108
Date:
2016-12-27 06:00:20 UTC
From:
To:
Dear Customer,

Your item has arrived at December 26, but our courier was not able to deliver the parcel.

Please check delivery label attached!

Yours truly,
Manuel Massey,
Delivery Agent.

#232584#113
Date:
2018-01-22 13:23:51 UTC
From:
To:
-- 
Hello Dear Friend,

Greetings and how are you doing?
I want to know if you are keen to be my partner in claiming the
fortune $12.8 Million USD left by a late client. If you're interested
revert for more details.

Awaiting your reply

Hamza Kabore

#232584#118
Date:
2020-04-06 17:41:00 UTC
From:
To:
Good Morning Dear,


I sent you a mail few days ago and I don't know if you receive it, I am
still waiting for your reply in regards to my mail.


Best Wishes
Marron Bennett.


Bonjour cher,


Je vous ai envoyé un mail il y a quelques jours et je ne sais pas si vous
le recevez, j'attends toujours votre réponse concernant mon mail.


Meilleurs vœux

#232584#123
Date:
2021-04-06 21:34:03 UTC
From:
To:
I've written a new version of the script for Bullseye, based on Yubao Liu's
version and the template in init-d-script(5). Attached should be the
/etc/init.d/svnserve script and /etc/defaults/svnserve file. I am not an
expert on scripting, but it seems to work. It still needs Yubao Liu's
logrotate file.

#232584#128
Date:
2021-04-21 15:04:36 UTC
From:
To:
And... that version didn't handle restarts properly. Here is a another
attempt...

Regards,

Roger