/usr/share/python-ase/doc/development/python-ase-buildmaster is in python-ase-doc 3.9.1.4567-3.
This file is owned by root:root, with mode 0o755.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 | #!/bin/sh
#
# python-ase: python-ase buildmaster
#
# chkconfig: 345 98 02
# description: python-ase buildmaster
# LSB init-info
### BEGIN INIT INFO
# Provides: python-ase
# Required-Start: $network
# Required-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: python-ase buildmaster
### END INIT INFO
# Source function library.
if [ -e /etc/init.d/functions ]; then
. /etc/init.d/functions
fi
# LSB functions
. /lib/lsb/init-functions
# Check that networking is configured.
[ "${NETWORKING}" = "no" ] && exit 0
RUN_AS=buildmaster-username
PYTHON_ASE_HOME=/home/$RUN_AS/python-ase
test -d $PYTHON_ASE_HOME || exit 5
LOGFILE=$PYTHON_ASE_HOME/../python-ase.log
PIDFILE=$PYTHON_ASE_HOME/../python-ase.pid
LOCKFILE=$PYTHON_ASE_HOME/../python-ase.lock
start() {
echo -n $"Starting python-ase buildmaster: "
dostatus > /dev/null 2>&1
if [ $RETVAL -eq 0 ]
then
echo -n $"python-ase buildmaster already running"
log_failure_msg
RETVAL=1
return
fi
#su - $RUN_AS -s /bin/sh -c "exec nohup /bin/sh $PYTHON_ASE_HOME/../python-ase-start.sh >> $LOGFILE 2>&1 &"
# don't produce log
su - $RUN_AS -s /bin/sh -c "exec nohup /bin/sh $PYTHON_ASE_HOME/../python-ase-start.sh >> /dev/null 2>&1 &"
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
sleep 5
su - $RUN_AS -s /bin/sh -c "cat $PYTHON_ASE_HOME/twistd.pid > $PIDFILE"
su - $RUN_AS -s /bin/sh -c "touch $LOCKFILE"
log_success_msg
else
log_failure_msg
fi
return $RETVAL
}
stop() {
echo -n $"Shutting down python-ase buildmaster: "
kill $(su - $RUN_AS -s /bin/sh -c "cat $PIDFILE 2>/dev/null") > /dev/null 2>&1
RETVAL=$?
sleep 5
if [ $RETVAL -eq 0 ]
then
su - $RUN_AS -s /bin/sh -c "rm -f $PIDFILE $LOCKFILE"
log_success_msg
else
log_failure_msg
fi
return $RETVAL
}
restart() {
stop
start
}
condrestart() {
[ -f $LOCKFILE ] && restart || :
}
dostatus() {
kill -0 $(cat $PIDFILE 2>/dev/null) > /dev/null 2>&1
RETVAL=$?
if [ $RETVAL -eq 0 ]
then
echo "python-ase buildmaster (pid $(cat $PIDFILE 2>/dev/null)) is running..."
else
if [ -f $PIDFILE ]
then
echo "python-ase buildmaster dead but pid file exists"
RETVAL=1
return
fi
if [ -f $LOCKFILE ]
then
echo "python-ase buildmaster dead but subsys locked"
RETVAL=2
return
fi
echo "python-ase buildmaster is stopped"
RETVAL=3
fi
}
# See how we were called.
case "$1" in
start)
start
;;
stop)
stop
;;
status)
dostatus
;;
restart|reload)
restart
;;
condrestart)
condrestart
;;
*)
echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
exit 1
esac
exit $RETVAL
|