mono-service 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/sh
  2. args=""
  3. assembly=
  4. debug=false
  5. while test x$1 != x; do
  6. case $1 in
  7. -[ldnm]:*) args="$args$1 " ;;
  8. --debug) debug=true ;;
  9. --no-daemon) debug=true ;;
  10. *) assembly=$1; args="$args$assembly ";;
  11. esac
  12. shift
  13. done
  14. if test x$assembly = x; then
  15. echo You must specify at least the assembly name
  16. echo
  17. echo "Usage is: $0 [options] service"
  18. echo
  19. echo ' -d:<directory> Working directory'
  20. echo ' -l:<lock file> Lock file (default is /tmp/<service>.lock)'
  21. echo ' -m:<syslog name> Name to show in syslog'
  22. echo ' -n:<service name> Name of service to start (default is first defined)'
  23. echo ' --debug Do not send to background nor redirect input/output'
  24. echo ' --no-daemon Do not send to background nor redirect input/output'
  25. echo
  26. echo Controlling the service:
  27. echo
  28. echo ' kill -USR1 `cat <lock file>` Pausing service'
  29. echo ' kill -USR2 `cat <lock file>` Continuing service'
  30. echo ' kill `cat <lock file>` Ending service'
  31. echo
  32. exit 1
  33. fi
  34. if $debug; then
  35. exec /Users/bokken/workspace/Build-mono/tmp/bin/mono $MONO_OPTIONS /Users/bokken/workspace/Build-mono/tmp/lib/mono/4.5/mono-service.exe $args
  36. else
  37. exec /Users/bokken/workspace/Build-mono/tmp/bin/mono $MONO_OPTIONS /Users/bokken/workspace/Build-mono/tmp/lib/mono/4.5/mono-service.exe $args </dev/null >/dev/null 2>&1 &
  38. fi