Created
September 23, 2012 18:08
-
-
Save hfase01/3772543 to your computer and use it in GitHub Desktop.
mono init.d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: fastmono | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: Fast-cgi-mono. | |
# Description: Fast-cgi-mono mono-fastcgi-server4 startup script. | |
### END INIT INFO | |
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin | |
DAEMON=/usr/local/bin/mono | |
NAME=monoserver | |
DESC=monoserver | |
MONOSERVER=$(which fastcgi-mono-server4) | |
MONOSERVER_PID=$(ps auxf | grep fastcgi-mono-server4.exe | grep -v grep | awk '{print $2}') | |
WEBAPPS="nuketest.hfase.com:/:/var/www/dotnetnuke/" | |
case "$1" in | |
start) | |
if [ -z "${MONOSERVER_PID}" ]; then | |
echo "starting mono server" | |
${MONOSERVER} /applications=${WEBAPPS} /socket=unix:///var/run/fastcgimono.sock & | |
echo "mono server started" | |
else | |
echo ${WEBAPPS} | |
echo "mono server is running" | |
fi | |
;; | |
stop) | |
if [ -n "${MONOSERVER_PID}" ]; then | |
kill ${MONOSERVER_PID} | |
echo "mono server stopped" | |
else | |
echo "mono server is not running" | |
fi | |
;; | |
esac | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment