Merge lp:~derek-name/openvista-gtm-integration/bug519042 into lp:openvista-gtm-integration

Proposed by Derek_
Status: Merged
Merged at revision: 138
Proposed branch: lp:~derek-name/openvista-gtm-integration/bug519042
Merge into: lp:openvista-gtm-integration
Diff against target: 495 lines (+146/-64)
15 files modified
docs/man1/openvista.1 (+5/-1)
docs/man1/ovbackup.1 (+6/-1)
docs/man1/ovcc.1 (+5/-1)
docs/man1/ovcheckperms.1 (+5/-1)
docs/man1/ovcompile.1 (+5/-1)
docs/man1/ovgetvar.1 (+5/-1)
docs/man1/ovimport.1 (+11/-9)
docs/man1/ovpurgejournals.1 (+5/-1)
docs/man1/ovswitchjournals.1 (+5/-1)
docs/man1/ovtied.1 (+5/-1)
docs/man8/gtmsignal.8 (+4/-2)
docs/man8/ovinstanceadd.8 (+9/-2)
docs/man8/ovinstancedel.8 (+6/-1)
docs/man8/ovrestore.8 (+6/-1)
scripts/usr/sbin/ovinstanceadd (+64/-40)
To merge this branch: bzr merge lp:~derek-name/openvista-gtm-integration/bug519042
Reviewer Review Type Date Requested Status
Jon Tai Approve
Review via email: mp+36486@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Jon Tai (jontai) wrote :

I like what you did with the man page, but I think the -h and -V lines should be separate. Also, please make the same change to all the other man pages.

The rest of the changes look good.

139. By Derek_

ovinstanceadd.8 (man page): Show that -h and -V options are each used exclusively of anything else.

140. By Derek_

Update all man pages, formatting the synopsis section to show -h and -V options as exclusive.

Revision history for this message
Jon Tai (jontai) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/man1/openvista.1'
2--- docs/man1/openvista.1 2009-12-01 21:55:02 +0000
3+++ docs/man1/openvista.1 2010-09-23 21:45:57 +0000
4@@ -2,8 +2,12 @@
5 .SH NAME
6 openvista \- wrapper around "mumps -dir" for programmers and admins
7 .SH SYNOPSIS
8-.B openvista [-h] [-V]
9+.B openvista
10 .I instance_name
11+.br
12+.B ovrestore -h
13+.br
14+.B ovrestore -V
15 .SH DESCRIPTION
16 .B openvista
17 is called by "full" users (programmers or administrators with a Linux account)
18
19=== modified file 'docs/man1/ovbackup.1'
20--- docs/man1/ovbackup.1 2009-12-10 22:00:27 +0000
21+++ docs/man1/ovbackup.1 2010-09-23 21:45:57 +0000
22@@ -2,8 +2,13 @@
23 .SH NAME
24 ovbackup \- back up routines and globals of an OpenVista instance
25 .SH SYNOPSIS
26-.B ovbackup [-h] [-V] [-q]
27+.B ovbackup
28+[\fB-q\fR]
29 .I instance_name
30+.br
31+.B ovbackup -h
32+.br
33+.B ovbackup -V
34 .SH DESCRIPTION
35 Each invocation of
36 .B ovbackup
37
38=== modified file 'docs/man1/ovcc.1'
39--- docs/man1/ovcc.1 2009-12-01 21:55:02 +0000
40+++ docs/man1/ovcc.1 2010-09-23 21:45:57 +0000
41@@ -2,8 +2,12 @@
42 .SH NAME
43 ovcc \- wrapper around "mumps -run ^MSCOVCI" for OpenVista Classic Component
44 .SH SYNOPSIS
45-.B ovcc [-h] [-V]
46+.B ovcc
47 .I instance_name
48+.br
49+.B ovcc -h
50+.br
51+.B ovcc -V
52 .SH DESCRIPTION
53 .B ovcc
54 is called as an SSH forced command. It is used by the OpenVista Classic
55
56=== modified file 'docs/man1/ovcheckperms.1'
57--- docs/man1/ovcheckperms.1 2009-12-12 01:26:41 +0000
58+++ docs/man1/ovcheckperms.1 2010-09-23 21:45:57 +0000
59@@ -2,8 +2,12 @@
60 .SH NAME
61 ovcheckperms \- verify permissions
62 .SH SYNOPSIS
63-.B ovcheckperms [-h] [-V]
64+.B ovcheckperms
65 .I instance_name
66+.br
67+.B ovcheckperms -h
68+.br
69+.B ovcheckperms -V
70 .SH DESCRIPTION
71 .B ovcheckperms
72 verifies that all files and directories in an OpenVista instance have the
73
74=== modified file 'docs/man1/ovcompile.1'
75--- docs/man1/ovcompile.1 2010-02-09 23:34:35 +0000
76+++ docs/man1/ovcompile.1 2010-09-23 21:45:57 +0000
77@@ -2,8 +2,12 @@
78 .SH NAME
79 ovcompile \- (re)compile routines in an OpenVista instance
80 .SH SYNOPSIS
81-.B ovcompile [-h] [-V]
82+.B ovcompile
83 .I instance_name
84+.br
85+.B ovcompile -h
86+.br
87+.B ovcompile -V
88 .SH DESCRIPTION
89 .B ovcompile
90 (re)compiles all routines in an OpenVista instance.
91
92=== modified file 'docs/man1/ovgetvar.1'
93--- docs/man1/ovgetvar.1 2009-12-12 01:26:41 +0000
94+++ docs/man1/ovgetvar.1 2010-09-23 21:45:57 +0000
95@@ -2,9 +2,13 @@
96 .SH NAME
97 ovgetvar \- get GT.M environment variable
98 .SH SYNOPSIS
99-.B ovgetvar [-h] [-V]
100+.B ovgetvar
101 .I instance_name
102 .I gtm_dist|gtm_path|gtmroutines|gtmgbldir
103+.br
104+.B ovgetvar -h
105+.br
106+.B ovgetvar -V
107 .SH DESCRIPTION
108 .B ovgetvar
109 prints the effective values of
110
111=== modified file 'docs/man1/ovimport.1'
112--- docs/man1/ovimport.1 2009-12-10 22:00:27 +0000
113+++ docs/man1/ovimport.1 2010-09-23 21:45:57 +0000
114@@ -2,16 +2,18 @@
115 .SH NAME
116 ovimport \- import routines and globals into an OpenVista instance
117 .SH SYNOPSIS
118-.B ovimport [-h] [-V] [-q] [-f] [-t
119-.I target
120-.B ] [-c
121-.I imported|all|none
122-.B ] [-r
123-.I routines
124-.B ] [-g
125-.I globals
126-.B ]
127+.B ovimport
128+[\fB-q\fR]
129+[\fB-f\fR]
130+[\fB-t\fR \fItarget\fR]
131+[\fB-c\fR \fIimported|all|none\fR]
132+[\fB-r\fR \fIroutines\fR]
133+[\fB-g\fR \fIglobals\fR]
134 .I instance_name
135+.br
136+.B ovimport -h
137+.br
138+.B ovimport -V
139 .SH DESCRIPTION
140 .B ovimport
141 imports routines and globals into an OpenVista instance.
142
143=== modified file 'docs/man1/ovpurgejournals.1'
144--- docs/man1/ovpurgejournals.1 2009-12-01 22:21:41 +0000
145+++ docs/man1/ovpurgejournals.1 2010-09-23 21:45:57 +0000
146@@ -2,8 +2,12 @@
147 .SH NAME
148 ovpurgejournals \- delete old journal files
149 .SH SYNOPSIS
150-.B ovpurgejournals [-h] [-V]
151+.B ovpurgejournals
152 .I instance_name
153+.br
154+.B ovpurgejournals -h
155+.br
156+.B ovpurgejournals -V
157 .SH DESCRIPTION
158 .B ovpurgejournals
159 deletes old journal files beyond the configured number of journal files to
160
161=== modified file 'docs/man1/ovswitchjournals.1'
162--- docs/man1/ovswitchjournals.1 2009-12-01 21:55:02 +0000
163+++ docs/man1/ovswitchjournals.1 2010-09-23 21:45:57 +0000
164@@ -2,8 +2,12 @@
165 .SH NAME
166 ovswitchjournals \- force GT.M to switch to a new journal file
167 .SH SYNOPSIS
168-.B ovswitchjournals [-h] [-V]
169+.B ovswitchjournals
170 .I instance_name
171+.br
172+.B ovswitchjournals -h
173+.br
174+.B ovswitchjournals -V
175 .SH DESCRIPTION
176 .B ovswitchjournals
177 forces GT.M to switch to a new journal file. If journaling is not enabled on a
178
179=== modified file 'docs/man1/ovtied.1'
180--- docs/man1/ovtied.1 2009-12-01 21:55:02 +0000
181+++ docs/man1/ovtied.1 2010-09-23 21:45:57 +0000
182@@ -2,8 +2,12 @@
183 .SH NAME
184 ovtied \- wrapper around "mumps -run ^ZU" for end users
185 .SH SYNOPSIS
186-.B ovtied [-h] [-V]
187+.B ovtied
188 .I instance_name
189+.br
190+.B ovtied -h
191+.br
192+.B ovtied -V
193 .SH DESCRIPTION
194 .B ovtied
195 is called as an SSH forced command for tied accounts. It presents
196
197=== modified file 'docs/man8/gtmsignal.8'
198--- docs/man8/gtmsignal.8 2009-08-03 19:22:13 +0000
199+++ docs/man8/gtmsignal.8 2010-09-23 21:45:57 +0000
200@@ -2,8 +2,10 @@
201 .SH NAME
202 gtmsignal \- send mupip STOP or INTRPT to GT.M processes
203 .SH SYNOPSIS
204-.B gtmsignal [-a|--all] [-s|--stop] [-h|--help] [-q|--quiet]
205-.I \fR[\fIpid\fR...]
206+.B gtmsignal
207+[\fB-a|--all\fR] [\fB-s|--stop\fR] [\fB-q|--quiet\fR] [\fIpid\fR...]
208+.br
209+.B gtmsignal -h|--help
210 .SH DESCRIPTION
211 .B mupip
212 can be used to send signals to other GT.M processes if the user calling mupip
213
214=== modified file 'docs/man8/ovinstanceadd.8'
215--- docs/man8/ovinstanceadd.8 2009-12-01 21:55:02 +0000
216+++ docs/man8/ovinstanceadd.8 2010-09-23 21:45:57 +0000
217@@ -1,9 +1,14 @@
218-.TH ovinstanceadd 8 "1 Dec 2009" Linux "User Manuals"
219+.TH ovinstanceadd 8 "22 Sep 2010" Linux "User Manuals"
220 .SH NAME
221 ovinstanceadd \- create a new OpenVista instance
222 .SH SYNOPSIS
223-.B ovinstanceadd [-h] [-V]
224+.B ovinstanceadd
225+[\fB-p\fR \fIpath\fR]
226 .I instance_name
227+.br
228+.B ovinstanceadd -h
229+.br
230+.B ovinstanceadd -V
231 .SH DESCRIPTION
232 .B ovinstanceadd
233 creates a new OpenVista instance. It ensures that the
234@@ -14,6 +19,8 @@
235 the instance, sets up an ssh forced command to run ^ZU in the instance, and
236 creates the webdav root for the instance.
237 .SH OPTIONS
238+.IP -p
239+path; value of $gtm_dist for this instance
240 .IP -h
241 display help text and exit
242 .IP -V
243
244=== modified file 'docs/man8/ovinstancedel.8'
245--- docs/man8/ovinstancedel.8 2009-12-01 21:55:02 +0000
246+++ docs/man8/ovinstancedel.8 2010-09-23 21:45:57 +0000
247@@ -2,8 +2,13 @@
248 .SH NAME
249 ovinstancedel \- delete an OpenVista instance
250 .SH SYNOPSIS
251-.B ovinstancedel [-h] [-V] [-y]
252+.B ovinstancedel
253+[\fB-y\fR]
254 .I instance_name
255+.br
256+.B ovinstancedel -h
257+.br
258+.B ovinstancedel -V
259 .SH DESCRIPTION
260 .B ovinstancedel
261 deletes an OpenVista instance. All routines, database files, journals,
262
263=== modified file 'docs/man8/ovrestore.8'
264--- docs/man8/ovrestore.8 2009-12-10 22:00:27 +0000
265+++ docs/man8/ovrestore.8 2010-09-23 21:45:57 +0000
266@@ -2,8 +2,13 @@
267 .SH NAME
268 ovrestore \- restores a backup file into an OpenVista instance
269 .SH SYNOPSIS
270-.B ovrestore [-h] [-V] [-y] [-q] [-j] [-f]
271+.B ovrestore
272+[\fB-y\fR] [\fB-q\fR] [\fB-j\fR] [\fB-f\fR]
273 .I backup_file instance_name
274+.br
275+.B ovrestore -h
276+.br
277+.B ovrestore -V
278 .SH DESCRIPTION
279 .B ovrestore
280 restores a backup created by
281
282=== modified file 'scripts/usr/sbin/ovinstanceadd'
283--- scripts/usr/sbin/ovinstanceadd 2010-05-27 17:41:20 +0000
284+++ scripts/usr/sbin/ovinstanceadd 2010-09-23 21:45:57 +0000
285@@ -8,21 +8,21 @@
286 # instance, and creates the webdav root for the instance.
287
288
289-# Copyright (C) 2009 Medsphere Systems Corporation
290+# Copyright (C) 2009-2010 Medsphere Systems Corporation
291 #
292 # This program is free software; you can redistribute it and/or modify it solely
293 # under the terms of the GNU Affero General Public License version 3 as published
294 # by the Free Software Foundation.
295-#
296+#
297 # This program is distributed in the hope that it will be useful, but WITHOUT
298 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
299 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
300 # for more details.
301-#
302+#
303 # You should have received a copy of the GNU Affero General Public License
304 # along with this program. If not, see <http://www.gnu.org/licenses>.
305-#
306-# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar
307+#
308+# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar
309 # Oaks Way, Suite 200, Carlsbad, CA 92008 or at legal@medsphere.com.
310
311
312@@ -30,14 +30,15 @@
313 . /usr/lib/openvista/functions
314
315 # parse arguments
316-while getopts hV option; do
317+while getopts hVp: option; do
318 case $option in
319 h)
320 cat <<EOF
321-Usage: ovinstanceadd INSTANCE_NAME
322+Usage: ovinstanceadd [-p PATH] INSTANCE_NAME
323 or ovinstanceadd -h
324 or ovinstanceadd -V
325
326+ -p path; value of $gtm_dist for this instance
327 -h display this help text and exit
328 -V display version information and exit
329 EOF
330@@ -45,14 +46,17 @@
331 ;;
332 V)
333 cat <<EOF
334-ovinstanceadd 0.8.9
335-Copyright (C) 2009 Medsphere Systems Corporation
336+ovinstanceadd 0.8.10
337+Copyright (C) 2009-2010 Medsphere Systems Corporation
338
339-ovinstanceadd is powered by Medsphere and part of a suite of open source
340-utilities licensed under the AGPL, available at http://medsphere.org.
341+ovinstanceadd is powered by Medsphere and part of a suite of open source
342+utilities licensed under the AGPL, available at http://medsphere.org.
343 EOF
344 exit 0
345 ;;
346+ p)
347+ gtm="$OPTARG"
348+ ;;
349 esac
350 done
351 shift `expr $OPTIND - 1`
352@@ -77,7 +81,7 @@
353
354 # check for for valid arguments (requires correct permissions to do; must happen after permission checks)
355 case $instance in
356- */*|*" "*|*"("*|*")"*)
357+ */*|*" "*|*"("*|*")"*) #"
358 echo "ovinstanceadd: $instance: Instance name cannot contain slashes, spaces, or parenthesis" >&2
359 exit 3
360 ;;
361@@ -88,6 +92,19 @@
362 exit 9
363 fi
364
365+# check the gtm path value, if it was specified
366+if [ "$gtm" ]; then
367+ [ -d "$gtm" ] \
368+ || { echo "ovinstanceadd: $gtm is not a directory" >&2
369+ exit 3; }
370+ [ -x "$gtm/mumps" ] \
371+ || { echo "ovinstanceadd: $gtm does not contain mumps" >&2
372+ exit 3; }
373+ [ -f "$gtm/openvista.xc" ] \
374+ || { echo "ovinstanceadd: $gtm does not contain openvista.xc" >&2
375+ exit 3; }
376+fi
377+
378 # check for other requirements
379 if [ ! -d "$root" ]; then
380 echo "ovinstanceadd: $root does not exist" >&2
381@@ -111,26 +128,33 @@
382 exit 1
383 fi
384
385-# find the latest version of GT.M installed on this system. to qualify as a
386-# valid GT.M version, the GT.M directory must contain a mumps executable and an
387-# openvista.xc file (the latter is installed by the corresponding
388-# openvista-libs-* package)
389-#
390-# sort using only the GT.M version (not including the _ and the arch) because _
391-# sorts after A, so if we were to use the entire directory name, V5.3-004A_i686
392-# would come before V5.3-004_i686 (so V5.3-004_i686 would be considered the
393-# "later" version), which is wrong.
394-for version in `ls -1 -d /opt/lsb-gtm/V*_i686 /opt/lsb-gtm/V*_x86_64 2> /dev/null | cut -d _ -f 1 | sort -r`; do
395- # prefer 64-bit GT.M over 32-bit GT.M
396- if [ -x "${version}_x86_64/mumps" ] && [ -f "${version}_x86_64/openvista.xc" ]; then
397- gtm="${version}_x86_64"
398- break
399- fi
400- if [ -x "${version}_i686/mumps" ] && [ -f "${version}_i686/openvista.xc" ]; then
401- gtm="${version}_i686"
402- break
403- fi
404-done
405+if [ -z "$gtm" ]; then
406+ # This is skipped if gtm was already set by the command line option.
407+ #
408+ # find the latest version of GT.M installed on this system. to qualify as a
409+ # valid GT.M version, the GT.M directory must contain a mumps executable and
410+ # an openvista.xc file (the latter is installed by the corresponding
411+ # openvista-libs-* package)
412+ #
413+ # sort using only the GT.M version (not including the _ and the arch)
414+ # because _ sorts after A, so if we were to use the entire directory name,
415+ # V5.3-004A_i686 would come before V5.3-004_i686 (so V5.3-004_i686 would be
416+ # considered the "later" version), which is wrong.
417+ for version in $(ls -1 -d /opt/lsb-gtm/V*_i686 /opt/lsb-gtm/V*_x86_64 \
418+ 2> /dev/null | cut -d _ -f 1 | sort -r); do
419+ # prefer 64-bit GT.M over 32-bit GT.M
420+ if [ -x "${version}_x86_64/mumps" ] \
421+ && [ -f "${version}_x86_64/openvista.xc" ]; then
422+ gtm="${version}_x86_64"
423+ break
424+ fi
425+ if [ -x "${version}_i686/mumps" ] \
426+ && [ -f "${version}_i686/openvista.xc" ]; then
427+ gtm="${version}_i686"
428+ break
429+ fi
430+ done
431+fi
432
433 if [ -z "$gtm" ]; then
434 echo "ovinstanceadd: No versions of GT.M found in /opt/lsb-gtm" >&2
435@@ -183,7 +207,7 @@
436 } || exit_with_error "ovinstanceadd" "Unable to create instance directories"
437
438 # now that the directory structure exists, we can safely call set_gtm_env
439-set_gtm_env "$instance" ||
440+set_gtm_env "$instance" ||
441 exit_with_error "ovinstanceadd" "Unable to set GT.M environment"
442
443 {
444@@ -212,7 +236,7 @@
445
446 # mumps doesn't exit non-zero even if something goes wrong in ^GDE, so look for
447 # the mumps.gld to determine success
448-[ -f "$root/$instance/globals/mumps.gld" ] ||
449+[ -f "$root/$instance/globals/mumps.gld" ] ||
450 exit_with_error "ovinstanceadd" "Unable to create global directory file"
451
452 {
453@@ -227,14 +251,14 @@
454 | grep -v '^$' \
455 | logger -p user.info -t "ovinstanceadd[$$]"
456 retval=${PIPESTATUS[0]}
457-[ $retval -eq 0 ] ||
458+[ $retval -eq 0 ] ||
459 exit_with_error "ovinstanceadd" "Unable to enable journaling"
460
461 (
462 umask 027
463 ssh-keygen -q -t rsa -f "$root/$instance/etc/$instance-tied_rsa_key" -C "$instance" -N "" &&
464 ssh-keygen -q -t rsa -f "$root/$instance/etc/$instance-ovcc_rsa_key" -C "$instance" -N ""
465-) ||
466+) ||
467 exit_with_error "ovinstanceadd" "Unable to generate SSH keys"
468
469 # convert SSH key to PuTTY format for easy installation on Windows clients
470@@ -258,10 +282,10 @@
471 command=$command" && cat '$root/$instance/etc/$instance-tied_rsa_key.pub' >> '$home/.ssh/authorized_keys'"
472 command=$command" && printf 'no-port-forwarding,no-X11-forwarding,no-agent-forwarding,command=\"/usr/bin/ovcc -- %s\" ' '$instance' >> '$home/.ssh/authorized_keys'"
473 command=$command" && cat '$root/$instance/etc/$instance-ovcc_rsa_key.pub' >> '$home/.ssh/authorized_keys'"
474-su -c "$command" "$user" ||
475+su -c "$command" "$user" ||
476 exit_with_error "ovinstanceadd" "Unable to update $home/.ssh/authorized_keys"
477
478-install -o "$apache_user" -g "$apache_user" -m 755 -d "$docroot/webdav/$instance" ||
479+install -o "$apache_user" -g "$apache_user" -m 755 -d "$docroot/webdav/$instance" ||
480 exit_with_error "ovinstanceadd" "Unable to create webdav root"
481
482 ln -s "$docroot/webdav/$instance" "$root/$instance/images"
483@@ -270,10 +294,10 @@
484 umask 077
485 tr -dc '_A-Z-a-z-0-9' < /dev/urandom | head -c16 > "$root/$instance/etc/$instance-webdav_password"
486 )
487-[ -f "$root/$instance/etc/$instance-webdav_password" ] ||
488+[ -f "$root/$instance/etc/$instance-webdav_password" ] ||
489 exit_with_error "ovinstanceadd" "Unable to generate WebDAV password"
490
491-htpasswd -b -m "$apache_conf/webdav.htpasswd" "$instance" "`cat \"$root/$instance/etc/$instance-webdav_password\"`" > /dev/null 2>&1 ||
492+htpasswd -b -m "$apache_conf/webdav.htpasswd" "$instance" "`cat \"$root/$instance/etc/$instance-webdav_password\"`" > /dev/null 2>&1 ||
493 exit_with_error "ovinstanceadd" "Unable to update $apache_conf/webdav.htpasswd"
494
495 for plugin in openvista_databases openvista_locks openvista_processes; do

Subscribers

People subscribed via source and target branches