[Mono-list] Re: mono-service
Robert Jordan
robertj at gmx.net
Wed Nov 2 15:28:53 EST 2005
Hi Peter,
The service doesn't start because of the RemoteSumsObject.dll
assembly. The remoting infrastructure loads this assembly
via reflection, which doesn't appear to work. Probably a
current directory issue ... However, the attached updated
monoservice script deals with that.
Rob
>> I'm attaching a init.d skeleton for mono-services, in the hope
>> that this (not quite mono related) problem will settle down
>> for a while.
>>
>> It's for SUSE, but it can be easily adapted to other distros.
>>
>> Robert
>
>
> Hi Robert,
>
> Sorry to be a pain, but I tried the script without any success. I have
> SuSE 9.3 Pro. Here's what I got:
>
> *****************
> peter at linux:~/MonoRemotingTest/RemoteSumsService/bin/Release> ls
> InstallUtil.InstallLog RemoteSumsService.exe
> monoservice RemoteSumsService.exe.config
> monoservice~ remotesumsservice.InstallLog
> RemoteSumsObject.dll remotesumsservice.InstallState
> peter at linux:~/MonoRemotingTest/RemoteSumsService/bin/Release> kdesu
> ./monoservice start
> peter at linux:~/MonoRemotingTest/RemoteSumsService/bin/Release> ps -eaf |
> grep RemoteSumsService
> peter 10160 9475 0 19:55 pts/2 00:00:00 grep RemoteSumsService
> peter at linux:~/MonoRemotingTest/RemoteSumsService/bin/Release>
-------------- next part --------------
#!/bin/sh
### BEGIN INIT INFO
# Provides: monoservice
# Required-Start: $network
# Required-Stop:
# Default-Start: 3 5
# Default-Stop: 0 1 2 6
# Short-Description: monoservice daemon
# Description: monoservice daemon
### END INIT INFO
# configure this
SERVICE_DRIVER=/usr/bin/mono-service
# configure this as well
SERVICE_ASSEMBLY=/path/to/assembly.exe
SERVICE_NAME=`basename $SERVICE_ASSEMBLY .exe`
SERVICE_DIR=`dirname $SERVICE_ASSEMBLY`
SERVICE_LOCK=/var/run/${SERVICE_NAME}.pid
# Load the rc.status script for this service.
. /etc/rc.status
# Reset status of this service
rc_reset
case "$1" in
start)
echo -n "Starting Mono Service $SERVICE_NAME "
$SERVICE_DRIVER -l:$SERVICE_LOCK -d:$SERVICE_DIR ${SERVICE_NAME}.exe
rc_status -v
;;
stop)
echo -n "Shutting down Mono Service $SERVICE_NAME "
test -f $SERVICE_LOCK && kill `cat $SERVICE_LOCK`
rc_status -v
;;
restart)
$0 stop
$0 start
rc_status
;;
reload)
rc_failed 3
rc_status -v
;;
status)
echo -n "Checking for Mono Service $SERVICE_NAME "
test -f $SERVICE_LOCK
rc_status -v
;;
pause)
echo -n "Pausing Mono Service $SERVICE_NAME "
test -f $SERVICE_LOCK && kill -USR1 `cat $SERVICE_LOCK`
rc_status -v
;;
resume)
echo -n "Resuming Mono Service $SERVICE_NAME "
test -f $SERVICE_LOCK && kill -USR2 `cat $SERVICE_LOCK`
rc_status -v
;;
*)
echo "Usage: $0 {start|stop|status|restart|reload|pause|resume}"
exit 1
;;
esac
rc_exit
More information about the Mono-list
mailing list