diff options
author | Pacho Ramos <pacho@gentoo.org> | 2012-01-22 12:54:29 +0000 |
---|---|---|
committer | Pacho Ramos <pacho@gentoo.org> | 2012-01-22 12:54:29 +0000 |
commit | f32a70b9d560af8e34754973febb97028e5e7dd2 (patch) | |
tree | c380b70a8d4fccf1f345a8708b41e3af369feb48 /dev-dotnet/xsp/files | |
parent | Revision bump to create stable candidate. (diff) | |
download | historical-f32a70b9d560af8e34754973febb97028e5e7dd2.tar.gz historical-f32a70b9d560af8e34754973febb97028e5e7dd2.tar.bz2 historical-f32a70b9d560af8e34754973febb97028e5e7dd2.zip |
Fix mod-mono-server init.d to support MonoServerVersion=4, bug #388669.
Package-Manager: portage-2.1.10.44/cvs/Linux x86_64
Diffstat (limited to 'dev-dotnet/xsp/files')
-rw-r--r-- | dev-dotnet/xsp/files/2.2/mod-mono-server-r1.initd | 83 |
1 files changed, 83 insertions, 0 deletions
diff --git a/dev-dotnet/xsp/files/2.2/mod-mono-server-r1.initd b/dev-dotnet/xsp/files/2.2/mod-mono-server-r1.initd new file mode 100644 index 000000000000..9e466461da80 --- /dev/null +++ b/dev-dotnet/xsp/files/2.2/mod-mono-server-r1.initd @@ -0,0 +1,83 @@ +#!/sbin/runscript +# Copyright 1999-2012 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Id: mod-mono-server-r1.initd,v 1.1 2012/01/22 12:54:29 pacho Exp $ + +depend() { + use net + after dotnet +} + +start() { + [ -z "$MonoServerRootDir" ] && \ + MonoServerRootDir="/usr/lib/xsp/test" + [ -z "$MonoApplications" ] && \ + MonoApplications="/mono:/usr/lib/xsp/test,/:." + [ -z "$UnixSocketFileName" ] && \ + UnixSocketFileName="/tmp/mod_mono_server" + [ -z "$MonoServerAddress" ] && \ + MonoServerAddress=127.0.0.1 + [ -z "$MonoServerPort" ] && \ + MonoServerPort=8080 + [ -z "$MonoServerVersion" ] && \ + MonoServerVersion=1 + + MONO_SERVER_OPTS="--root ${MonoServerRootDir} \ +--applications ${MonoApplications} --nonstop" + + [ -n "$MonoApplicationsConfigDir" ] && \ + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--appconfigdir ${MonoApplicationsConfigDir}" + + case "$MonoServerChannel" in + "tcp" ) + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--address ${MonoServerAddress} --port ${MonoServerPort}" + ;; + + "unix" ) + [ -f "$UnixSocketFileName" ] && rm -f $UnixSocketFileName + MONO_SERVER_OPTS="${MONO_SERVER_OPTS} \ +--filename ${UnixSocketFileName}" + ;; + + * ) + eerror "Please set a valid value for MonoServerChannel" + return 1 + ;; + esac + + if [ ${MonoServerVersion} -eq 1 ]; then + modmonoserverpath=1.0/mod-mono-server.exe + elif [ ${MonoServerVersion} -eq 2 ]; then + modmonoserverpath=2.0/mod-mono-server2.exe + elif [ ${MonoServerVersion} -eq 4 ]; then + modmonoserverpath=4.0/mod-mono-server4.exe + else + eerror "MonoServerVersion was not properly set. Check your /etc/conf.d/mod-mono-server" + return 1 + fi + + export MONO_SHARED_DIR=/tmp + + ebegin "Starting mod-mono-server" + + start-stop-daemon --quiet --start \ + --background \ + --make-pidfile \ + --pidfile /var/run/aspnet/mod-mono-server.pid \ + --user aspnet \ + --exec /usr/bin/mono /usr/lib/mono/${modmonoserverpath} \ + -- $MONO_SERVER_OPTS + + eend $? +} + +stop() { + ebegin "Stopping mod-mono-server" + + start-stop-daemon --quiet --stop \ + --pidfile /var/run/aspnet/mod-mono-server.pid + + eend $? +} |