forked from ome/omero-install
-
Notifications
You must be signed in to change notification settings - Fork 0
/
omero-web-init.d
72 lines (65 loc) · 1.38 KB
/
omero-web-init.d
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
#!/bin/bash
#
# /etc/init.d/omero
# Subsystem file for "omero" server
#
### BEGIN INIT INFO
# Provides: omero-web
# Required-Start: $local_fs $remote_fs $network $time omero postgresql
# Required-Stop: $local_fs $remote_fs $network $time omero postgresql
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OMERO.web
### END INIT INFO
#
### Redhat
# chkconfig: - 98 02
# description: Init script for OMERO.web
###
RETVAL=0
prog=omero-web
# Read configuration variable file if it is present
[ -r /etc/default/$prog ] && . /etc/default/$prog
# also read the omero config
[ -r /etc/default/omero ] && . /etc/default/omero
OMERO_SERVER=${OMERO_SERVER:-/home/omero/OMERO.server}
OMERO_USER=${OMERO_USER:-omero}
OMERO=${OMERO_SERVER}/bin/omero
start() {
echo -n $"Starting $prog:"
su - ${OMERO_USER} -c "${OMERO} web start" &> /dev/null && echo -n ' OMERO.web'
RETVAL=$?
[ "$RETVAL" = 0 ]
echo
}
stop() {
echo -n $"Stopping $prog:"
su - ${OMERO_USER} -c "${OMERO} web stop" &> /dev/null && echo -n ' OMERO.web'
RETVAL=$?
[ "$RETVAL" = 0 ]
echo
}
status() {
echo -n $"Status $prog:"
su - ${OMERO_USER} -c "${OMERO} web status"
RETVAL=$?
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart)
stop
start
;;
status)
status
;;
*)
echo $"Usage: $0 {start|stop|restart|status}"
RETVAL=1
esac
exit $RETVAL