-
Notifications
You must be signed in to change notification settings - Fork 0
/
galaxyd
executable file
·74 lines (55 loc) · 1.41 KB
/
galaxyd
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
#!/bin/bash
# Author: toutain, vazov, 20a12, tt
# chkconfig: 35 87 15
# description: Galaxy start/stop daemon
. /etc/init.d/functions
start ()
{
## Check if apache exists and is running
if ! type apachectl > /dev/null || apachectl status > /dev/null; then
# Make sure galaxy tree exists
if [ -d '/home/galaxy/galaxy' ]; then
daemon --user="galaxy" /home/galaxy/galaxy/run.sh --daemon
return 0
else
>&2 echo "Galaxy tree not found"
return 1
fi
else
echo "Waiting for Apache to start..."
apachectl restart
daemon --user="galaxy" /home/galaxy/galaxy/run.sh --daemon
fi
## Check if munge exists and is running
if ! type munge > /dev/null || systemctl status munge.service > /dev/null; then
if [ ! -f /var/run/munge/munged.pid ]; then
echo "Munge PID missing. Restarting Munge!"
rm -rf /var/run/munge/*
systemctl restart munge.service
fi
echo "Munge is running!"
else
echo "Waiting for Munge to start..."
if [ -f /var/run/munge/munged.pid ]; then
echo "Removing trailing munge pid!"
rm -rf /var/run/munge/*
fi
systemctl start munge.service
echo "Started Munge!"
fi
}
stop ()
{
/home/galaxy/galaxy/run.sh --stop-daemon
}
restart ()
{
stop
start
}
case "$1" in
start) start; RETVAL=$? ;;
stop) stop; RETVAL=$? ;;
restart) restart; RETVAL=$? ;;
esac
exit $RETVAL