Hi,
I wanted to install local instances of Galaxy connected to PostgreSQL. Using combination of web user guides
http://vallandingham.me/galaxy_install.html and
http://www.agapow.net/science/bioinf...talling-galaxy, I managed to complete essentially the same install on two machines - 64-bit SciLinux55 and 64-bit RHEL58. Manual launch works fine on both machines:
Code:
su - galaxy
cd galaxy-dist
sh run.sh --reload
......
Starting server in PID 26613.
serving on 0.0.0.0:7070 view at http://127.0.0.1:7070
[CTRL-c]
^C caught in monitor process
Both guides end with creating launch scripts, albeit different. Although these can be accessed on the web pages, I provide them here:
http://www.agapow.net/science/bioinf...talling-galaxy
Code:
#!/bin/bash
#
# /etc/rc.d/init.d/galaxy
#
# Manages the Galaxy webserver
# Based on http://www.sensi.org/~alec/unix/redhat/sysvinit.html
#
# chkconfig: 2345 80 20
# description: Manages the Galaxy webserver
# The chkconfig is levels, strat priority, stop priority. Last two should add to 100.
# You get an error/failure if you try to restrat a stopped service.
# Source function library.
. /etc/rc.d/init.d/functions
GALAXY_USER=galaxy
GALAXY_DIST_HOME=/home/galaxy/galaxy_dist
GALAXY_RUN="${GALAXY_DIST_HOME}/run.sh"
GALAXY_PID="${GALAXY_DIST_HOME}/paster.pid"
case "$1" in
start)
echo -n "Starting galaxy services: "
daemon --user $GALAXY_USER "${GALAXY_RUN} --daemon --pid-file=${GALAXY_PID}"
touch /var/lock/subsys/galaxy
;;
stop)
echo -n "Shutting down galaxy services: "
daemon --user $GALAXY_USER "${GALAXY_RUN} --stop-daemon"
rm -f /var/lock/subsys/galaxy
;;
status)
daemon --user galaxy "${GALAXY_RUN} --status"
;;
restart)
$0 stop; $0 start
;;
reload)
$0 stop; $0 start
;;
*)
echo "Usage: galaxy {start|stop|status|reload|restart"
exit 1
;;
esac
and
http://vallandingham.me/galaxy_install.html
Code:
#!/bin/bash
#--- config
SERVICE_NAME=galaxy
RUN_AS=galaxy
RUN_IN=/usr/local/galaxy/galaxy-dist
#--- main actions
start() {
echo "Starting $SERVICE_NAME... "
cmd="cd $RUN_IN && sh run.sh --daemon"
case "$(id -un)" in
$RUN_AS)
eval "$cmd"
;;
root)
su - $RUN_AS -c "$cmd"
;;
*)
echo "*** ERROR *** must be $RUN_AS or root in order to control this service" >&2
exit 1
esac
echo "...done."
}
stop() {
echo -n "Stopping $SERVICE_NAME... "
cmd="cd $RUN_IN && sh run.sh --stop-daemon"
case "$(id -un)" in
$RUN_AS)
eval "$cmd"
;;
root)
su - $RUN_AS -c "$cmd"
;;
*)
echo "*** ERROR *** must be $RUN_AS or root in order to control this service" >&2
exit 1
esac
echo "done."
}
status() {
echo -n "$SERVICE_NAME status: "
while read pid; do
if [ "$(readlink -m /proc/$pid/cwd)" = "$(readlink -m $RUN_IN)" ]; then
echo "started"
return 0
fi
done < <(ps ax -o 'pid cmd' | grep -P '^\s*\d+ python ./scripts/paster.py serve' | awk '{print $1}')
echo "stopped"
return 3
}
notsupported() {
echo "*** ERROR*** $SERVICE_NAME: operation [$1] not supported"
}
usage() {
echo "Usage: $SERVICE_NAME start|stop|restart|status"
}
#---
case "$1" in
start)
start "$@"
;;
stop)
stop
;;
restart|reload)
stop
start
;;
status)
set +e
status
exit $?
;;
'')
usage >&2
exit 1
;;
*)
notsupported "$1" >&2
usage >&2
exit 1
;;
esac
I just copied these and saved as /etc/init.d/galaxy and /etc/init.d/galaxys. What puzzled me is that the first script (/etc/init.d/galaxy from Agapow.net) works as intended in SciLinux55. However, the very same script does not work on RHEL59 generating error:
Code:
[root@G5NNJN1 ~]# /etc/init.d/galaxy start
Starting galaxy services: ERROR: Your Python version is: 2.4
Galaxy is currently supported on Python 2.5, 2.6 and 2.7. To run Galaxy,
please download and install a supported version from python.org. If a
supported version is installed but is not your default, getgalaxy.org
contains instructions on how to force Galaxy to use a different version.
[root@G5NNJN1 ~]# python -V
Python 2.7
[root@G5NNJN1 ~]# su - galaxy
[galaxy@G5NNJN1 ~]$ python -V
Python 2.7
[galaxy@G5NNJN1 ~]$
However, the second script (/etc/init.d/galaxys from Vallandingham's web site) works on RHEL58 just as supposed to without complains.
What could be the issue?