Permalink
Browse files

Improved spawning of Mono process

  • Loading branch information...
1 parent 0ed49e9 commit 28bfcaab723bd8b3cf88591fb8e0cfbf88450234 @mikeplate committed Sep 24, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 nginx-add-mono.sh
View
@@ -18,7 +18,11 @@ fi
source "${0%/*}/nginx-common.sh"
# Ensure requirements are installed
-apt-get -yq install mono-fastcgi-server4
+apt-get -yq install mono-fastcgi-server4 >> tmp/logfile
+if [ $? -ne 0 ]; then
+ echo 'Could not install Mono'
+ exit
+fi
# Determine site information. Separate domain name and port from second argument.
SITENAME=$1
@@ -58,7 +62,7 @@ description "Mono ASP.NET for user $RUN_AS_USER"
start on (filesystem and net-device-up IFACE!=lo)
stop on runlevel [!2345]
respawn
-exec sudo -u $RUN_AS_USER /usr/bin/fastcgi-mono-server4 /applications=/:$DESTDIR/public /socket=tcp:127.0.0.1:$CGIPORT
+exec start-stop-daemon --start --chuid $RUN_AS_USER --exec /usr/bin/fastcgi-mono-server4 /applications=/:$DESTDIR/public /socket=tcp:127.0.0.1:$CGIPORT
EOF
start mono-$RUN_AS_USER
if [ $? -ne 0 ]; then

0 comments on commit 28bfcaa

Please sign in to comment.