Installing mono-xsp2 alongside mono-xsp in feisty

Asked by Matt Austin

There is a known bug where mono-xsp2 cannot be installed from the repositories if mono-xsp is already installed:
https://bugs.launchpad.net/ubuntu/+source/xsp/+bug/99798

I have mono-xsp installed (and in fact I cannot remove it!) - and need to install mono-xsp2.

Could someone please provide me with a guide on how to edit the deb initscript so I can make the appropriate modification?

Alternatively, if someone could provide a patched deb I would be immensely grateful!

Thanks.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu Edit question
Assignee:
No assignee Edit question
Solved by:
mos
Solved:
Last query:
Last reply:
Revision history for this message
Andrea Corbellini (andrea.corbellini) said :
#1

The deb package is here: http://packages.ubuntu.com/feisty/web/mono-xsp2 and it is in the Ubuntu repo.
This is for debian, if you prefer: http://packages.debian.org/unstable/web/mono-xsp2

Revision history for this message
Matt Austin (mattaustin) said :
#2

Thanks Andrea - but the Ubuntu package in the link you provided is version 1.2.1-1 - the same as the version in the repositories (with the bug).

The Debian package is version 1.2.4-1 - and this has unsatisfied dependencies that will only be met with gutsy.

I guess I am after a patched version of 1.2.1-1 so that it will work with Ubuntu 7.04 (fiesty).

Thanks.

Revision history for this message
Best mos (marcosmoslares) said :
#3

Hello,
i have solve it makin this:

1: create at /etc/init.d a file named "mono-xsp2"
2: paste this into it:
#! /bin/sh
### BEGIN INIT INFO
# Provides: mono-xsp2
# Required-Start:
# Required-Stop:
# Should-Start:
# Should-Stop:
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Mono XSP2
# Description: Debian init script for Mono XSP2.
### END INIT INFO
#
# Written by Pablo Fischer <email address hidden>
# Dylan R. E. Moonfire <email address hidden>
# Modified for Debian GNU/Linux
#
# Version: @(#)mono-xsp2 <email address hidden>
#

# Variables
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
DAEMON=/usr/bin/xsp2
DESC="XSP 2 WebServer"
DEFAULT=/etc/default/$NAME
CFGDIR=/etc/xsp2
VIRTUALFILE=$CFGDIR/debian.webapp
MONO_SHARED_DIR=/var/run/$NAME

# Use LSB
. /lib/lsb/init-functions

# If we don't have the basics, don't bother
test -x $DAEMON || exit 0
test -f $DEFAULT && . $DEFAULT

if [ ! -e $MONO_SHARED_DIR ];then
       mkdir $MONO_SHARED_DIR
       chown $user.$group $MONO_SHARED_DIR
fi

should_start() {
    if [ ! -e $VIRTUALFILE -o `cat $VIRTUALFILE | wc -l` = "2" ]; then
        log_action_msg "You have an incomplete $VIRTUALFILE"
        log_action_msg "To fix it, you need to install at least one package for xsp2 (like asp.net-examples)"
        return 1
    fi

    if [ -f /var/run/$NAME.pid ]; then
        # Are we really running xsp2?
        xsp2_pid=`cat /var/run/$NAME.pid`
        xsp2_ps=`ps -p $xsp2_pid | wc -l`
        if [ "$xsp2_ps" != "1" ]; then
            log_action_msg "Sorry, there is already a xsp2 running, stop it first"
            return 1
        fi
    fi

    return 0

}

case "$1" in
    start)
        if should_start ; then
            log_daemon_msg "Starting $DESC" "$NAME"
            export MONO_SHARED_DIR
            start-stop-daemon --start --background --make-pidfile \
                --quiet --pidfile /var/run/$NAME.pid \
                --user $user --group $group --chuid $user \
                --exec $DAEMON -- \
                --port $port --address $address --appconfigdir \
                $CFGDIR --nonstop
            log_end_msg $?
        fi
        ;;
    stop)
        log_daemon_msg "Stopping $DESC" "$NAME"
        for i in $(ps aux | grep -v grep | grep 'xsp2.exe' | cut -c 10-15)
        do
                kill $i >& /dev/null
        done
        log_end_msg $?
        ;;
    restart|force-reload)
        $0 stop
        $0 start
        ;;
    *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
        exit 1
        ;;
esac

exit 0

3: set the "mono-xsp2" created file whit this perms:
-rwxr-xr-x

4: at terminal execute again:

 apt-get install mono-xsp2

(all this whit root user, else make all this using sudo)

hope it helps

Revision history for this message
Matt Austin (mattaustin) said :
#4

Thanks mos, that solved my question.