Skip to content

Instantly share code, notes, and snippets.

@sinewalker
Created April 4, 2011 05:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sinewalker/901187 to your computer and use it in GitHub Desktop.
Save sinewalker/901187 to your computer and use it in GitHub Desktop.
A kludge to get Subversion Edge Apache server to run as an LSB service
#! /bin/sh
###############################################################################
#
# File: edge-csvn
# Language: LSB Init Script
# Time-stamp: <2011-04-04 15:46:51 mjl>
# Platform: Unix workstation
# OS: Linux
# Authors: Michael Lockhart [MJL] (sinewalker@gmail.com)
#
# Rights: Use this however you like, just don't sue me
#
# PURPOSE: A kludge to get Collabnet Subversion Edge Apache server
# csvn-httpd to run as service. Also a bare-bones
# template for LSB service scripts.
#
# The csvn-httpd script that comes with Collabnet
# Subversion Edge is able to start and stop the Apache
# service. However it assumes it's running as the
# installed user, and does not provide the LSB headers
# required by insserv and other LSB-compliant service
# tools.
#
# This is a simple wrapper with LSB headers. It offloads
# all actual work to the Collabnet script.
#
# Be sure to set $EDGE_HOME and $EDGE_USER before you
# install this script.
#
# HISTORY
#
# MJL20110404 - Created, based upon auto-fs from openSUSE
#
#-----------------------------------------------------------------------------
# The following two lines are used by the chkconfig command. Change as is
# appropriate for your application. They should remain commented.
# chkconfig: 2345 20 80
# description: Subversion Edge Apache Server
# Initialization block for the install_initd and remove_initd scripts
# used by SUSE linux distributions.
### BEGIN INIT INFO
# Provides: edge.csvn
# Required-Start: $local_fs $network $syslog
# Should-Start:
# Required-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: edge.csvn
# Description: Subversion Edge Apache Server
### END INIT INFO
#
# Installation details for Collabnet Subversion Edge
EDGE_HOME=/srv/edge/bin
EDGE_USER=svn
prog="Subversion Edge Apache Server"
# source rc functions
. /etc/rc.status
# dumb wrapper
function call_csvn_httpd() {
su $EDGE_USER -c "$EDGE_HOME/csvn-httpd $1"
return $?
}
# ?
RETVAL=0
case "$1" in
start|stop|status)
call_csvn_httpd "$1"
rc_status -v
;;
restart|graceful|graceful-stop)
call_csvn_httpd restart
rc_status
;;
*)
echo "Usage: $0 {start|graceful|stop|graceful-stop|status|restart}"
exit 1
;;
esac
rc_exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment