- Package:
- subversion
- Source:
- subversion
- Description:
- Advanced version control system
- Submitter:
- Benedict Adamson
- Date:
- 2021-04-21 15:09:03 UTC
- Severity:
- wishlist
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.
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 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.
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
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.
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.
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.
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
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
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
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
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?
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
My name Tabitha contact me urgently now so that i can tell you more details about me
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.
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.
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.
-- 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
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
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.
And... that version didn't handle restarts properly. Here is a another attempt... Regards, Roger