view init.d/kallithea-daemon-debian @ 4546:805ec49152c9

simplehg: don't quiet Hg output for push I want to be able to see informational messages from e.g. the Hg Bugzilla extension. Here's output without the patch. This is identical to the output produced if the Bugzilla extension is disabled: remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: Repository size .hg:158.2 kB repo:0 B total:158.2 kB remote: Last revision is now r324:6c03abbabb46 and with the patch: remote: adding changesets remote: adding manifests remote: adding file changes remote: added 1 changesets with 1 changes to 1 files remote: Repository size .hg:158.2 kB repo:0 B total:158.2 kB remote: Last revision is now r324:6c03abbabb46 remote: bug 3270 already knows about changeset 6c03abbabb46 The last line indicates that the Bugzilla bug text already contains an entry for that changeset. It's produced by a call to self.ui.status() in the extension. I think the point here is that the deleted code is ensuring that the remote hg (i.e. the Kallithea hg) always runs with the --quiet flag when receiving a push. This seems an arbitrary decision to me, and one that removes potentially useful information from the output. I believe this behaviour is different to that seen by the user if pushing to hgweb (I've not tried it, but inspected the hgweb source for setting quiet) and is certainly different to pushing over ssh.
author Jim Hague <jim.hague@acm.org>
date Thu, 17 Jul 2014 12:47:56 +0100
parents 99ad9d0af1a3
children e285bb7abb28
line wrap: on
line source

#!/bin/sh -e
########################################
#### THIS IS A DEBIAN INIT.D SCRIPT ####
########################################
 
### BEGIN INIT INFO
# Provides:          kallithea          
# Required-Start:    $all
# Required-Stop:     $all
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: starts instance of kallithea
# Description:       starts instance of kallithea using start-stop-daemon
### END INIT INFO
 
APP_NAME="kallithea"
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="/$APP_HOMEDIR/$APP_NAME-venv"
 
RUN_AS="root"
 
DAEMON="$PYTHON_PATH/bin/paster"
 
DAEMON_OPTS="serve --daemon \
 --user=$RUN_AS \
 --group=$RUN_AS \
 --pid-file=$PID_PATH \
 --log-file=$LOG_PATH  $APP_PATH/$CONF_NAME"
 
 
start() {
  echo "Starting $APP_NAME"
  PYTHON_EGG_CACHE="/tmp" start-stop-daemon -d $APP_PATH \
      --start --quiet \
      --pidfile $PID_PATH \
      --user $RUN_AS \
      --exec $DAEMON -- $DAEMON_OPTS
}
 
stop() {
  echo "Stopping $APP_NAME"
  start-stop-daemon -d $APP_PATH \
      --stop --quiet \
      --pidfile $PID_PATH || echo "$APP_NAME - Not running!"
 
  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
    ;;
  restart)
    echo "Restarting $APP_NAME"
    ### stop ###
    stop
    wait
    ### start ###
    start
    ;;
  *)
    echo "Usage: $0 {start|stop|restart}"
    exit 1
esac