-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathserver-daemon.sh
46 lines (42 loc) · 1.22 KB
/
server-daemon.sh
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
#!/bin/bash
#
# Can interact with the Galaxy server instance
#
# Usage
#
# $ bash server-daemon.sh start|stop|restart
#
# Make sure that below path point to your Galaxy installation
GALAXY_ROOT_DIR=`pwd`
# check the input arguments
if [ $# -eq 0 ] ; then
echo 'Please mention the service operation like start|stop|restart'
exit 1
fi
#
# check the run.sh file in GALAXY_ROOT_DIR
if [ ! -f run.sh ] ; then
echo 'No run.sh file here. Please check the GALAXY_ROOT_DIR'
exit 1
fi
#
# check the universe.ini file for Galaxy service
if [ ! -f universe_wsgi.ini ]; then
echo 'No universe_wsgi.ini Galaxy configuration file here. Please check the GALAXY_ROOT_DIR'
exit 1
fi
#
# do the operations
if [ "$1" == "start" ] ; then
echo Starting the Galaxy Server
bash $GALAXY_ROOT_DIR/run.sh --daemon --log-file=$GALAXY_ROOT_DIR/galaxy_instance_run.log
elif [ "$1" == "stop" ] ; then
echo Stopping the Galaxy Server
bash $GALAXY_ROOT_DIR/run.sh --stop-daemon
elif [ "$1" == "restart" ] ; then
echo Restarting the Galaxy Server
bash $GALAXY_ROOT_DIR/run.sh --stop-daemon
bash $GALAXY_ROOT_DIR/run.sh --daemon --log-file=$GALAXY_ROOT_DIR/galaxy_instance_run.log
fi
#
echo DONE