Fedora Linux Support Community & Resources Center

Go Back   FedoraForum.org > Fedora 17/18 > Using Fedora
FedoraForum Search

Forgot Password? Join Us!

Using Fedora General support for current versions. Ask questions about Fedora and it's software that do not belong in any other forum.

Reply
 
Thread Tools Search this Thread Display Modes
  #1  
Old 27th May 2008, 07:37 PM
Cerin Offline
Registered User
 
Join Date: Jul 2007
Posts: 31
Running SVNServe as a Service

I installed subversion, but noticed the package doesn't include any service for running svnserve. Is this right? I'd like to run the daemon automatically, and find it hard to believe no one else has ever wanted to do that as well. I've found a few xinetd hacks, but would rather stick to getting it listed in the services GUI, but apparently no ones figured out how to do this.
Reply With Quote
  #2  
Old 16th February 2009, 08:19 AM
dpant Offline
Registered User
 
Join Date: Feb 2009
Posts: 3
I just want to comment that I have svnserve successfully up and running in my Western Digital MyBook World's gnu/linux while this very same thing seems impossible in fedora 10. I've spent more than 4 hours last night trying to configure xinetd and run svnserve as a service but no luck. If anyone really knows what is going on please give a hand.
Reply With Quote
  #3  
Old 16th February 2009, 03:06 PM
dpant Offline
Registered User
 
Join Date: Feb 2009
Posts: 3
Okay, here is how to setup svnserver on fedora 10:

1. in case you haven't installed it yet, use yum to do so now:

Code:
yum install subversion
2. screw xinetd, it's not going to work. Fedora likes Sys V scripts instead. Create the /etc/init.d/svnserve file and write this script in it:

Code:
#!/bin/bash

case "$1" in
	start)
		svnserve -d --listen-port=3690
		;;
	stop)
		;;
	reload|restart)
		$0 stop
		$0 start
		;;
	*)
		echo "usage: $0 start|stop|restart|reload"
		exit 1
esac
exit 0
3. grand execution permissions to the script above:

Code:
chmod a+x svnserve
4. add the svn listening port to the /etc/services file by adding the following two lines in it:

Code:
svnserve 3690/tcp    # Subversion
svnserve 3690/udp  # Subversion
5. type in the following commands:
Code:
chkconfig svnserve
service svnserve start
6. check that the service is listening:
Code:
netstat -anp | grep 3690
you can now check on your repos by using svn urls, e.g:
Code:
svn list svn://localhost/path-to-repository
or use the following url if you have setup a non-default port, e.g:
Code:
svn list svn://localhost:PORT/path-to-repository
I am still missing the STOP command in the script. Any nice ideas?

Hope that helps
Reply With Quote
  #4  
Old 16th February 2009, 04:18 PM
Cerin Offline
Registered User
 
Join Date: Jul 2007
Posts: 31
My condolences on xinetd. I came to the same conclusion a while ago. My solution was pretty much the same as yours.

Great work on the step-by-step guide.

Here's my svnserve script:

Code:
#!/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 /etc/rc.d/init.d/functions

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

### Default variables
REPO_ROOT=/path/to/your/svnrepos
#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 -r $REPO_ROOT --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
Reply With Quote
  #5  
Old 17th December 2012, 11:24 PM
davinken Offline
Registered User
 
Join Date: Jul 2009
Location: College Station, TX
Posts: 4
linuxopera
Talking Re: Running SVNServe as a Service

On the newer Fedoras (17 in this case):

Enable the service (same as former chkconfig svnserve on)::
Code:
systemctl enable svnserve.service
Start the daemon
Code:
systemctl start svnserve.service
__________________
David Ramirez
Houston TX
Reply With Quote
Reply

Tags
running, service, svnserve

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem adding svnserve as a service lipidinc Using Fedora 11 31st August 2007 10:54 AM
Running mldonkey as a service, service does not startup Dhana Servers & Networking 2 14th August 2006 04:43 AM
running Folding@Home service GarySaved Security and Privacy 3 16th March 2006 05:15 AM
running vnc as service code3hree Using Fedora 4 5th August 2005 09:19 AM
Possible to start Subversion (svnserve) as a service buskmann Using Fedora 2 28th May 2005 04:39 PM


Current GMT-time: 10:13 (Friday, 24-05-2013)

TopSubscribe to XML RSS for all Threads in all ForumsFedoraForumDotOrg Archive
logo

All trademarks, and forum posts in this site are property of their respective owner(s).
FedoraForum.org is privately owned and is not directly sponsored by the Fedora Project or Red Hat, Inc.

Privacy Policy | Term of Use | Posting Guidelines | Archive | Contact Us | Founding Members

Powered by vBulletin® Copyright ©2000 - 2012, vBulletin Solutions, Inc.

FedoraForum is Powered by RedHat