Added xsp hosting infrastructure

2007-11-07  Marek Habersack  <mhabersack@novell.com>

	* packaging/opensuse/xsp2.init, packaging/opensuse/Makefile.am,
	packaging/opensuse/xsp2.logrotate, tools/mono-asp-apps/Makefile.am,
	packaging/opensuse/sysconfig.xsp2, packaging/opensuse/xsp.spec,
	packaging/Makefile.am: added

svn path=/trunk/xsp/; revision=89105
This commit is contained in:
Marek Habersack 2007-11-07 14:50:00 +00:00
Родитель 5bd2d8016d
Коммит bf158ad150
12 изменённых файлов: 509 добавлений и 2 удалений

Просмотреть файл

@ -1,3 +1,10 @@
2007-11-07 Marek Habersack <mhabersack@novell.com>
* packaging/opensuse/xsp2.init, packaging/opensuse/Makefile.am,
packaging/opensuse/xsp2.logrotate, tools/mono-asp-apps/Makefile.am,
packaging/opensuse/sysconfig.xsp2, packaging/opensuse/xsp.spec,
packaging/Makefile.am: added
2007-11-03 Marek Habersack <mhabersack@novell.com>
* test/1.1/webcontrols/dbpage1.aspx,

Просмотреть файл

@ -1,2 +1,2 @@
SUBDIRS=man src test tools scripts docs
SUBDIRS=man src test tools scripts docs packaging

Просмотреть файл

@ -102,6 +102,8 @@ AC_OUTPUT([
man/asp-state.1
man/mono-asp-apps.1
man/Makefile
packaging/Makefile
packaging/opensuse/Makefile
scripts/Makefile
src/Makefile
src/Mono.WebServer/AssemblyInfo.cs
@ -134,6 +136,7 @@ AC_OUTPUT([
tools/asp_state/AssemblyInfo.cs
tools/dbsessmgr/Makefile
tools/dbsessmgr/AssemblyInfo.cs
tools/mono-asp-apps/Makefile
docs/Makefile
])

1
packaging/Makefile.am Normal file
Просмотреть файл

@ -0,0 +1 @@
SUBDIRS=opensuse

Просмотреть файл

@ -0,0 +1 @@
EXTRA_DIST = xsp2.init xsp2.fw sysconfig.xsp2 xsp2.logrotate

Просмотреть файл

@ -0,0 +1,29 @@
## Path: Network/Remote access/xsp2
## Description: XSP2 server settings
## Type: string
## Default: ""
## ServiceRestart: xsp2
#
# Port on which xsp2 is to listen for requests
#
XSP_PORT="8080"
#
# Address on which xsp2 is to listen for requests
#
XSP_ADDRESS="0.0.0.0"
#
# Configuration directory which contains application definition files
#
XSP_APPCONFIGDIR="/etc/xsp/2.0/applications-enabled/"
#
# Should mono be ran with debugging enabled (backtraces with lines on errors)
#
XSP_DEBUG="no"
#
# Extra options you might want to pass to xsp2, see man xsp
#
XSP_EXTRA_OPTIONS=""

147
packaging/opensuse/xsp.spec Normal file
Просмотреть файл

@ -0,0 +1,147 @@
# norootforbuild
Name: xsp
URL: http://go-mono.com/
License: GNU General Public License (GPL)
Group: Productivity/Networking/Web/Servers
Autoreqprov: on
Version: 1.2.5
Release: 2.novell
Summary: Small Web Server Hosting ASP.NET
Source: %{name}-%{version}.tar.bz2
#Patch: xsp-libexecdir.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-build
BuildArch: noarch
BuildRequires: mono-devel mono-web pkgconfig
##### suse ####
%if 0%{?suse_version}
%define old_suse_buildrequires mono-data mono-winforms
%define _fwdefdir /etc/sysconfig/SuSEfirewall2.d/services
%if %suse_version == 1000
BuildRequires: %{old_suse_buildrequires}
%endif
%if %sles_version == 9
BuildRequires: %{old_suse_buildrequires}
%endif
%endif
# Fedora options (Bug in fedora images where 'abuild' user is the same id as 'nobody')
%if 0%{?fedora_version}
%define env_options export MONO_SHARED_DIR=/tmp
%endif
%define xspConfigsLocation /etc/xsp/2.0
%define xspAvailableApps %{xspConfigsLocation}/applications-available
%define xspEnabledApps %{xspConfigsLocation}/applications-enabled
%description
The XSP server is a small Web server that hosts the Mono System.Web
classes for running what is commonly known as ASP.NET.
%debug_package
%prep
%setup -q
%build
%{?env_options}
# Cannot use the configure macro because noarch-redhat-linux is not recognized by the auto tools in the tarball
./configure --prefix=%{_prefix} \
--libexecdir=%{_prefix}/lib \
--libdir=%{_prefix}/lib \
--mandir=%{_prefix}/share/man \
--infodir=%{_prefix}/share/info \
--sysconfdir=%{_sysconfdir}
make
%install
%{?env_options}
make install DESTDIR=$RPM_BUILD_ROOT
mkdir -p ${RPM_BUILD_ROOT}/%{xspAvailableApps}
mkdir -p ${RPM_BUILD_ROOT}/%{xspEnabledApps}
mkdir -p ${RPM_BUILD_ROOT}/%{_fwdefdir}
mkdir -p ${RPM_BUILD_ROOT}/usr/share
mv ${RPM_BUILD_ROOT}/usr/lib/pkgconfig ${RPM_BUILD_ROOT}/usr/share
%if 0%{?suse_version}
mkdir -p ${RPM_BUILD_ROOT}/etc/init.d/
mkdir -p ${RPM_BUILD_ROOT}/var/adm/fillup-templates
mkdir -p ${RPM_BUILD_ROOT}/etc/logrotate.d/
mkdir -p ${RPM_BUILD_ROOT}/srv/xsp2
install -m 644 packaging/opensuse/xsp2.fw ${RPM_BUILD_ROOT}/%{_fwdefdir}/xsp2
install -m 755 packaging/opensuse/xsp2.init ${RPM_BUILD_ROOT}/etc/init.d/xsp2
install -m 644 packaging/opensuse/sysconfig.xsp2 ${RPM_BUILD_ROOT}/var/adm/fillup-templates
install -m 644 packaging/opensuse/xsp2.logrotate ${RPM_BUILD_ROOT}/etc/logrotate.d/xsp2
install -m 755 tools/mono-asp-apps/mono-asp-apps ${RPM_BUILD_ROOT}/usr/bin/mono-asp-apps
install -m 544 man/mono-asp-apps.1 ${RPM_BUILD_ROOT}/usr/share/man/man1/mono-asp-apps.1
%endif
%clean
rm -rf $RPM_BUILD_ROOT
%if 0%{?suse_version}
%pre
/usr/sbin/groupadd -o -r monoxsp 2> /dev/null || :
/usr/sbin/useradd -r -o -g monoxsp -s /bin/false -c "SSH daemon" -d /srv/xsp2 monoxsp 2> /dev/null || :
%post
%{fillup_and_insserv -n -s xsp2 xsp2 START_XSP2}
%preun
%stop_on_removal sshd
%postun
%restart_on_update xsp2
%{insserv_cleanup}
%endif
%files
%defattr(-,root,root)
%{_prefix}/bin/*
%{_prefix}/share/pkgconfig/*
%{_prefix}/share/man/*/*
%{_prefix}/lib/xsp
%{_prefix}/lib/mono/gac/Mono.WebServer
%{_prefix}/lib/mono/1.0/Mono.WebServer.dll
%{_prefix}/lib/mono/gac/Mono.WebServer2
%{_prefix}/lib/mono/2.0/Mono.WebServer2.dll
%{_prefix}/lib/mono/gac/xsp
%{_prefix}/lib/mono/1.0/xsp.exe
%{_prefix}/lib/mono/gac/xsp2
%{_prefix}/lib/mono/2.0/xsp2.exe
%{_prefix}/lib/mono/gac/mod-mono-server
%{_prefix}/lib/mono/1.0/mod-mono-server.exe
%{_prefix}/lib/mono/gac/mod-mono-server2
%{_prefix}/lib/mono/2.0/mod-mono-server2.exe
%{_prefix}/lib/mono/1.0/fastcgi-mono-server.exe
%{_prefix}/lib/mono/2.0/fastcgi-mono-server2.exe
%{_prefix}/lib/mono/gac/fastcgi-mono-server/
%{_prefix}/lib/mono/gac/fastcgi-mono-server2/
%if 0%{?suse_version}
%config %{_fwdefdir}/xsp2
%config /etc/init.d/xsp2
%config /etc/logrotate.d/xsp2
/var/adm/fillup-templates/*
%attr(0711,monoxsp,monoxsp) /srv/xsp2
%{xspConfigsLocation}/*
%endif
%doc NEWS README
# auto dep/req generation for older distros (it will take a while for the .config scanning to get upstream)
%if 0%{?suse_version} <= 1040 || 0%{?fedora_version} <= 7
%if 0%{?fedora_version}
# Allows overrides of __find_provides in fedora distros... (already set to zero on newer suse distros)
%define _use_internal_dependency_generator 0
%endif
%define __find_provides env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-provides && printf "%s\\n" "${filelist[@]}" | /usr/bin/mono-find-provides ; } | sort | uniq'
%define __find_requires env sh -c 'filelist=($(cat)) && { printf "%s\\n" "${filelist[@]}" | /usr/lib/rpm/find-requires && printf "%s\\n" "${filelist[@]}" | /usr/bin/mono-find-requires ; } | sort | uniq'
%endif
%changelog

Просмотреть файл

@ -0,0 +1,5 @@
## Name: Mono XSP2 ASP.NET Host Service
## Description: Open ports for Mono XSP2 server
# space separated list of allowed TCP ports
TCP="8080"

301
packaging/opensuse/xsp2.init Executable file
Просмотреть файл

@ -0,0 +1,301 @@
#!/bin/sh
#
# System startup script for XSP2
# Copyright (C) 1995--2005 Kurt Garloff, SUSE / Novell Inc.
#
# This library is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or (at
# your option) any later version.
#
# This library is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
# Lesser General Public License for more details.
#
# You should have received a copy of the GNU Lesser General Public
# License along with this library; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
# USA.
#
# System startup script for XSP2
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux/SUSE/Novell based Linux distributions. If you want to base your
# script on this template and ensure that it works on non UL based LSB
# compliant Linux distributions, you either have to provide the rc.status
# functions from UL or change the script to work without them.
# See skeleton.compat for a template that works with other distros as well.
#
### BEGIN INIT INFO
# Provides: xsp2
# Required-Start: $syslog $remote_fs $local_fs $network
# Should-Start: $time ypbind smtp
# Required-Stop: $syslog $remote_fs
# Should-Stop: $time ypbind smtp
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: xsp2 daemon providing ASP.NET hosting
# Description: Start xsp2 to run ASP.NET applications with
# the Mono runtime.
### END INIT INFO
#
# Any extensions to the keywords given above should be preceeded by
# X-VendorTag- (X-UnitedLinux- X-SuSE- for us) according to LSB.
#
# Notes on Required-Start/Should-Start:
# * There are two different issues that are solved by Required-Start
# and Should-Start
# (a) Hard dependencies: This is used by the runlevel editor to determine
# which services absolutely need to be started to make the start of
# this service make sense. Example: nfsserver should have
# Required-Start: $portmap
# Also, required services are started before the dependent ones.
# The runlevel editor will warn about such missing hard dependencies
# and suggest enabling. During system startup, you may expect an error,
# if the dependency is not fulfilled.
# (b) Specifying the init script ordering, not real (hard) dependencies.
# This is needed by insserv to determine which service should be
# started first (and at a later stage what services can be started
# in parallel). The tag Should-Start: is used for this.
# It tells, that if a service is available, it should be started
# before. If not, never mind.
# * When specifying hard dependencies or ordering requirements, you can
# use names of services (contents of their Provides: section)
# or pseudo names starting with a $. The following ones are available
# according to LSB (1.1):
# $local_fs all local file systems are mounted
# (most services should need this!)
# $remote_fs all remote file systems are mounted
# (note that /usr may be remote, so
# many services should Require this!)
# $syslog system logging facility up
# $network low level networking (eth card, ...)
# $named hostname resolution available
# $netdaemons all network daemons are running
# The $netdaemons pseudo service has been removed in LSB 1.2.
# For now, we still offer it for backward compatibility.
# These are new (LSB 1.2):
# $time the system time has been set correctly
# $portmap SunRPC portmapping service available
# UnitedLinux extensions:
# $ALL indicates that a script should be inserted
# at the end
# * The services specified in the stop tags
# (Required-Stop/Should-Stop)
# specify which services need to be still running when this service
# is shut down. Often the entries there are just copies or a subset
# from the respective start tag.
# * Should-Start/Stop are now part of LSB as of 2.0,
# formerly SUSE/Unitedlinux used X-UnitedLinux-Should-Start/-Stop.
# insserv does support both variants.
# * X-UnitedLinux-Default-Enabled: yes/no is used at installation time
# (%fillup_and_insserv macro in %post of many RPMs) to specify whether
# a startup script should default to be enabled after installation.
# It's not used by insserv.
#
# Note on runlevels:
# 0 - halt/poweroff 6 - reboot
# 1 - single user 2 - multiuser without network exported
# 3 - multiuser w/ network (text mode) 5 - multiuser w/ network and X11 (xdm)
#
# Note on script names:
# http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/scrptnames.html
# A registry has been set up to manage the init script namespace.
# http://www.lanana.org/
# Please use the names already registered or register one or use a
# vendor prefix.
# Check for missing binaries (stale symlinks should not happen)
# Note: Special treatment of stop for LSB conformance
XSP2_BIN=/usr/lib/mono/2.0/xsp2.exe
MONO_BIN=/usr/bin/mono
test -x $XSP2_BIN || { echo "$XSP2_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
test -x $MONO_BIN || { echo "$XSP2_BIN not installed";
if [ "$1" = "stop" ]; then exit 0;
else exit 5; fi; }
# Check for existence of needed config file and read it
XSP2_CONFIG=/etc/sysconfig/xsp2
test -r $XSP2_CONFIG || { echo "$XSP2_CONFIG not existing";
if [ "$1" = "stop" ]; then exit 0;
else exit 6; fi; }
# Defaults
XSP_PORT="8080"
XSP_ADDRESS="0.0.0.0"
XSP_APPCONFIGDIR="/etc/xsp/2.0/applications-enabled/"
XSP_DEBUG="no"
# Read config
. $XSP2_CONFIG
XSP_ROOTDIR="/srv/xsp2"
XSP_ROOTAPP="--applications /:$XSP_ROOTDIR"
XSP_OPTIONS="--nonstop --port $XSP_PORT --address $XSP_ADDRESS $XSP_ROOTAPP --appconfigdir $XSP_APPCONFIGDIR --root $XSP_ROOTDIR $XSP_EXTRA_OPTIONS"
XSP_PIDFILE=/var/run/xsp2.pid
if test "x$XSP_DEBUG" = "xyes"; then
MONO_OPTIONS="$MONO_OPTIONS --debug"
fi
# Source LSB init functions
# providing start_daemon, killproc, pidofproc,
# log_success_msg, log_failure_msg and log_warning_msg.
# This is currently not used by UnitedLinux based distributions and
# not needed for init scripts for UnitedLinux only. If it is used,
# the functions from rc.status should not be sourced or used.
#. /lib/lsb/init-functions
# Shell functions sourced from /etc/rc.status:
# rc_check check and set local and overall rc status
# rc_status check and set local and overall rc status
# rc_status -v be verbose in local rc status and clear it afterwards
# rc_status -v -r ditto and clear both the local and overall rc status
# rc_status -s display "skipped" and exit with status 3
# rc_status -u display "unused" and exit with status 3
# rc_failed set local and overall rc status to failed
# rc_failed <num> set local and overall rc status to <num>
# rc_reset clear both the local and overall rc status
# rc_exit exit appropriate to overall rc status
# rc_active checks whether a service is activated by symlinks
. /etc/rc.status
# Reset status of this service
rc_reset
# Return values acc. to LSB for all commands but status:
# 0 - success
# 1 - generic or unspecified error
# 2 - invalid or excess argument(s)
# 3 - unimplemented feature (e.g. "reload")
# 4 - user had insufficient privileges
# 5 - program is not installed
# 6 - program is not configured
# 7 - program is not running
# 8--199 - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.
case "$1" in
start)
echo -n "Starting xsp2 "
## Start daemon with startproc(8). If this fails
## the return value is set appropriately by startproc.
export MONO_OPTIONS
MYPID=`/sbin/startproc -v -p $XSP_PIDFILE -l /var/log/xsp2.log -u monoxsp -g monoxsp -- $MONO_BIN $MONO_OPTIONS $XSP2_BIN $XSP_OPTIONS`
if test "`readlink /proc/$MYPID/exe`" = "/usr/bin/mono"; then
echo $MYPID > $XSP_PIDFILE
else
rc_failed 7
fi
# Remember status and be verbose
rc_status -v
;;
stop)
echo -n "Shutting down xsp2 "
if test -f $XSP_PIDFILE; then
MYPID=`cat $XSP_PIDFILE`
if test "`readlink /proc/$MYPID/exe`" = "/usr/bin/mono"; then
kill -TERM $MYPID
else
rc_failed 7
fi
rm -f $XSP_PIDFILE
else
rc_failed 7
fi
# Remember status and be verbose
rc_status -v
;;
try-restart|condrestart)
## Do a restart only if the service was active before.
## Note: try-restart is now part of LSB (as of 1.9).
## RH has a similar command named condrestart.
if test "$1" = "condrestart"; then
echo "${attn} Use try-restart ${done}(LSB)${attn} rather than condrestart ${warn}(RH)${norm}"
fi
$0 status
if test $? = 0; then
$0 restart
else
rc_reset # Not running is not a failure.
fi
# Remember status and be quiet
rc_status
;;
restart)
## Stop the service and regardless of whether it was
## running or not, start it again.
$0 stop
$0 start
# Remember status and be quiet
rc_status
;;
force-reload)
## Signal the daemon to reload its config. Most daemons
## do this on signal 1 (SIGHUP).
## If it does not support it, restart the service if it
## is running.
echo -n "Reload service xsp2 "
## if it supports it:
#/sbin/killproc -HUP $XSP2_BIN
#touch /var/run/xsp2.pid
#rc_status -v
## Otherwise:
$0 try-restart
rc_status
;;
reload)
## Like force-reload, but if daemon does not support
## signaling, do nothing (!)
# If it supports signaling:
echo -n "Reload service xsp2 "
#/sbin/killproc -HUP $XSP2_BIN
#touch /var/run/xsp2.pid
#rc_status -v
## Otherwise if it does not support reload:
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for service xsp2 "
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
# Return value is slightly different for the status command:
# 0 - service up and running
# 1 - service dead, but /var/run/ pid file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running (unused)
# 4 - service status unknown :-(
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)
# NOTE: checkproc returns LSB compliant status values.
/sbin/checkproc $XSP2_BIN
# NOTE: rc_status knows that we called this init script with
# "status" option and adapts its messages accordingly.
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|try-restart|restart|force-reload|reload}"
exit 1
;;
esac
rc_exit

Просмотреть файл

@ -0,0 +1,12 @@
/var/log/xsp2.log {
compress
dateext
maxage 365
rotate 99
missingok
notifempty
size +4096k
create 640 root root
sharedscripts
}

Просмотреть файл

@ -1,2 +1,2 @@
SUBDIRS = asp_state dbsessmgr
SUBDIRS = asp_state dbsessmgr mono-asp-apps

Просмотреть файл

@ -0,0 +1 @@
EXTRA_DIST = mono-asp-apps README