X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=blobdiff_plain;f=scripts%2Fmono-service.in;h=f86087ec9c8c3e7425181222610fd173474c18fd;hb=HEAD;hp=bb5a8185033c7722ab1198be750635c6a22293aa;hpb=c3272462ce87dc9ea961695c1bb8c38bc3aed4d3;p=mono.git diff --git a/scripts/mono-service.in b/scripts/mono-service.in index bb5a8185033..f86087ec9c8 100644 --- a/scripts/mono-service.in +++ b/scripts/mono-service.in @@ -1,19 +1,41 @@ #!/bin/sh -args="$@" +args="" assembly= +debug=false while test x$1 != x; do case $1 in - -[ldnm]:*) ;; - *) assembly=$1;; + -[ldnm]:*) args="$args$1 " ;; + --debug) debug=true ;; + --no-daemon) debug=true ;; + *) assembly=$1; args="$args$assembly ";; esac shift done if test x$assembly = x; then echo You must specify at least the assembly name - echo Usage is: - echo mono-service [-d:DIRECTORY] [-l:LOCKFILE] [-n:NAME] [-m:LOGNAME] service.exe + echo + echo "Usage is: $0 [options] service" + echo + echo ' -d: Working directory' + echo ' -l: Lock file (default is /tmp/.lock)' + echo ' -m: Name to show in syslog' + echo ' -n: Name of service to start (default is first defined)' + echo ' --debug Do not send to background nor redirect input/output' + echo ' --no-daemon Do not send to background nor redirect input/output' + echo + echo Controlling the service: + echo + echo ' kill -USR1 `cat ` Pausing service' + echo ' kill -USR2 `cat ` Continuing service' + echo ' kill `cat ` Ending service' + echo exit 1 fi -exec @bindir@/@mono_interp@ @mono_one_instdir@/@exe_file@ "$args" \ No newline at end of file +export MONO_DISABLE_SHM=1 +if $debug; then + exec @bindir@/@mono_interp@ $MONO_OPTIONS @mono_instdir@/@framework_version@/mono-service.exe $args +else + exec @bindir@/@mono_interp@ $MONO_OPTIONS @mono_instdir@/@framework_version@/mono-service.exe $args /dev/null 2>&1 & +fi