39
48
# Oaks Way, Suite 200, Carlsbad, CA 92008 or at legal@medsphere.com.
51
# Check the package is still installed. Traditionally, the test is for a
52
# program that is executed later in this script, but it's not trivial to find
53
# the location of the mumps binary because multiple verisons could be
54
# installed, so look for the functions script instead.
55
[ -f /usr/lib/openvista/functions ] || exit 0
42
57
# Source function library.
43
. /etc/rc.d/init.d/functions
58
[ -f /etc/rc.d/init.d/functions ] && . /etc/rc.d/init.d/functions
59
[ -f /lib/lsb/init-functions ] && . /lib/lsb/init-functions
44
60
. /usr/lib/openvista/functions
46
62
root="/opt/openvista"
100
116
if [ -z "$2" ]; then
101
echo "Starting OpenVista..."
117
if function_exists "action"; then
118
echo "Starting OpenVista..."
119
elif function_exists "log_daemon_msg"; then
120
log_daemon_msg "Running startup hooks for OpenVista databases"
103
123
for instance in `ls $root`; do
104
124
[ -L "$root/$instance/gtm" ] || continue
106
action $" Running startup hooks for $instance: " run_hook "$instance" ZSTART
126
if function_exists "action"; then
127
action $" Running startup hooks for $instance: " run_hook "$instance" ZSTART
128
elif function_exists "log_daemon_msg"; then
129
log_progress_msg "$instance"
130
run_hook "$instance" ZSTART || end_msg=1
132
run_hook "$instance" ZSTART
136
if function_exists "log_daemon_msg"; then
137
log_end_msg ${end_msg:-0}
109
action $"Running startup hooks for $instance: " run_hook "$instance" ZSTART
140
if function_exists "action"; then
141
action $"Running startup hooks for $instance: " run_hook "$instance" ZSTART
142
elif function_exists "log_daemon_msg"; then
143
log_daemon_msg "Running startup hooks for OpenVista databases" "$instance"
144
run_hook "$instance" ZSTART
147
run_hook "$instance" ZSTART
113
152
if [ -z "$2" ]; then
114
echo "Stopping OpenVista..."
153
if function_exists "action"; then
154
echo "Stopping OpenVista..."
155
elif function_exists "log_daemon_msg"; then
156
log_daemon_msg "Running shutdown hooks for OpenVista databases"
116
159
for instance in `ls $root`; do
117
160
[ -L "$root/$instance/gtm" ] || continue
119
action $" Running shutdown hooks for $instance: " run_hook "$instance" ZSTOP
162
if function_exists "action"; then
163
action $" Running shutdown hooks for $instance: " run_hook "$instance" ZSTOP
164
elif function_exists "log_daemon_msg"; then
165
log_progress_msg "$instance"
166
run_hook "$instance" ZSTOP || end_msg=1
168
run_hook "$instance" ZSTOP
172
if function_exists "log_daemon_msg"; then
173
log_end_msg ${end_msg:-0}
122
action $"Running shutdown hooks for $instance: " run_hook "$instance" ZSTOP
176
if function_exists "action"; then
177
action $"Running shutdown hooks for $instance: " run_hook "$instance" ZSTOP
178
elif function_exists "log_daemon_msg"; then
179
log_daemon_msg "Running shutdown hooks for OpenVista databases" "$instance"
180
run_hook "$instance" ZSTOP
183
run_hook "$instance" ZSTOP
125
187
# give background jobs (e.g., TaskMan) some time to wake up and realize they've been asked to shut down
190
restart|force-reload)
129
echo "Usage: openvista {start|stop} [INSTANCE_NAME]" >&2
195
echo "Usage: openvista {start|stop|restart|force-reload} [INSTANCE_NAME]" >&2