Changeset - f9540f9c5999
[Not reviewed]
beta
0 1 0
Marcin Kuzminski - 13 years ago 2013-01-25 02:32:00
marcin@python-works.com
little improvements for debian init.d script
1 file changed with 19 insertions and 5 deletions:
0 comments (0 inline, 0 general)
init.d/rhodecode-daemon2
Show inline comments
 
@@ -11,23 +11,23 @@
 
# Default-Stop:      0 1 6
 
# Short-Description: starts instance of rhodecode
 
# Description:       starts instance of rhodecode using start-stop-daemon
 
### END INIT INFO
 

	
 
APP_NAME="rhodecode"
 
APP_HOMEDIR="marcink/python_workspace"
 
APP_PATH="/home/$APP_HOMEDIR/$APP_NAME"
 
APP_HOMEDIR="opt"
 
APP_PATH="/$APP_HOMEDIR/$APP_NAME"
 

	
 
CONF_NAME="production.ini"
 

	
 
PID_PATH="$APP_PATH/$APP_NAME.pid"
 
LOG_PATH="$APP_PATH/$APP_NAME.log"
 

	
 
PYTHON_PATH="/home/$APP_HOMEDIR/v-env"
 
PYTHON_PATH="/$APP_HOMEDIR/$APP_NAME-venv"
 

	
 
RUN_AS="marcink"
 
RUN_AS="root"
 

	
 
DAEMON="$PYTHON_PATH/bin/paster"
 

	
 
DAEMON_OPTS="serve --daemon \
 
  --user=$RUN_AS \
 
  --group=$RUN_AS \
 
@@ -52,13 +52,27 @@ stop() {
 
  
 
  if [ -f $PID_PATH ]; then
 
    rm $PID_PATH
 
  fi
 
}
 

	
 
status() {
 
  echo -n "Checking status of $APP_NAME ... "
 
  pid=`cat $PID_PATH`
 
  status=`ps ax | grep $pid | grep -ve grep`
 
  if [ "$?" -eq 0 ]; then
 
    echo "running"
 
  else
 
    echo "NOT running"
 
  fi
 
}
 
 
 
case "$1" in
 
  status)
 
   status
 
    ;;
 
  start)
 
    start
 
    ;;
 
  stop)
 
    stop
 
    ;;
 
@@ -70,7 +84,7 @@ case "$1" in
 
    ### start ###
 
    start
 
    ;;
 
  *)
 
    echo "Usage: $0 {start|stop|restart}"
 
    exit 1
 
esac
 
esac
 
\ No newline at end of file
0 comments (0 inline, 0 general)