1 &  ******************************************************
  2 &  *                                                    *
  3 &  * Copyright, (C) Honeywell Bull Inc., 1987           *
  4 &  *                                                    *
  5 &  * Copyright (c) 1972 by Massachusetts Institute of   *
  6 &  * Technology and Honeywell Information Systems, Inc. *
  7 &  *                                                    *
  8 &  ******************************************************
  9 
 10 &
 11 & ADMIN.EC - extended operator commands.
 12 &
 13 & This exec_com is invoked from system_control_ when the operator says
 14 &                   x function arg1 arg2 ...
 15 &
 16 & "admin" mode is set so that the console which issued the "x" will get the output.
 17 &
 18 &goto &1
 19 &
 20 & MODIFICATION HISTORY
 21 &
 22 & Modified 1895-03-18, BIM: added complete_dump, wakeup_dump, and end_dump
 23 & Modified 1985-05-08, E. Swenson: fixed  requoting problems as per Gary
 24 &   Dixon's changes.
 25 &
 26 &
 27 &  HISTORY COMMENTS:
 28 &   1) change(1987-07-30,Beattie), approve(1987-07-20,MCR7743),
 29 &      audit(1987-08-04,Brunelle), install(1987-08-06,MR12.1-1068):
 30 &      Add check to look for admin_dsa.ec before complaining about
 31 &      functions unknown to this exec_com.  Pass along arguments if
 32 &      found.
 33 &   2) change(2018-01-12,Swenson), approve(2018-01-12,MCR10040),
 34 &      audit(2018-01-13,GDixon), install(2018-01-16,MR12.6g-0003):
 35 &      Fix "x repair" entry to not cause an answering service dump if no
 36 &      arguments are supplied.
 37 &   3) change(2018-01-17,Swenson), approve(2018-01-17,MCR10045),
 38 &      audit(2018-01-23,Anthony), install(2018-01-23,MR12.6g-0011):
 39 &      Fix "x vcons" to not use obsolete control argument -skip_incr_count N
 40 &      to consolidated_volume_dump command.
 41 &                                                       END HISTORY COMMENTS
 42 &
 43 &
 44 & -----------------------------------------------------------------
 45 & I/O daemons
 46 &
 47 &  x io   starts coordinator, prta
 48 &  x io1  starts coordinator, prta, puna
 49 &
 50 &label io
 51 &label io1
 52 sc_command r cord coordinator
 53 pause 10
 54 &label prta
 55 sc_command r prta driver
 56 sc_command r prta prta
 57 sc_command r prta go
 58 &if [equal &r1 io1] &then &goto punch
 59 &quit
 60 &
 61 &label punch
 62 &label puna
 63 sc_command r puna driver
 64 sc_command r puna puna
 65 sc_command r puna go
 66 &quit
 67 &
 68 &label punch_end
 69 &label end_punch
 70 sc_command r puna halt
 71 sc_command r puna new_device
 72 &quit
 73 &
 74 &label punch_restart
 75 sc_command r puna puna
 76 sc_command r puna go
 77 &quit
 78 &
 79 &label read_cards
 80 &label cards
 81 &label rc
 82 clean_card_pool -age 7
 83 & delete all card input over 7 days old
 84 sc_command login IO SysDaemon rdra
 85 pause 10
 86 sc_command r rdra driver
 87 sc_command r rdra rdra
 88 sc_command r rdra read_cards
 89 &quit
 90 &
 91 &
 92 &label reprint
 93 &label rep
 94 &
 95 & exec_com to reprint a file for a user.
 96 &
 97 dprint -q 1 -he REPRINT -ds &r3 &r2
 98 &quit
 99 &
100 & -----------------------------------------------------------------
101 &  Commands to control automatic, attended, and unattended modes
102 &
103 &label auto
104 &  USAGE: x auto on OR x auto off
105 &
106 &if [nequal &n 2] &then &else &goto auto_error
107 &if [equal &r2 on] &then &else &goto not_auto_on
108 set_flagbox auto_reboot true
109 &quit
110 &label not_auto_on
111 &if [equal &r2 off] &then &else &goto auto_error
112 set_flagbox auto_reboot false
113 &quit
114 &
115 &label auto_error
116 &print --------->>> ERROR. USAGE: x auto on OR x auto off
117 &quit
118 &
119 &label attend
120 &label attended
121 reconfigure_rcp$add_device tape_(01 02 03 04 05 06 07 08)
122 sc_command word login
123 & flagbox 5 = "1"b means "unattended"
124 set_flagbox 5 false
125 &quit
126 &
127 &label unattend
128 &label unattended
129 reconfigure_rcp$del_device tape_(01 02 03 04 05 06 07 08)
130 sc_command word login Unattended service
131 set_flagbox 5 true
132 set_flagbox auto_reboot true
133 set_flagbox rebooted false
134 &quit
135 &
136 & -----------------------------------------------------------------
137 & Allow the operator to interrogate the state of the IO queues.
138 &
139 &label print_queues
140 &label pq
141 &
142 & exec_com to print total requests in the I/O Daemon queues
143 &
144 ldr -a -tt &rf2
145 &
146 &quit
147 &
148 & -----------------------------------------------------------------
149 & Incremental, Consolidated, and Complete Volume Dumps
150 &
151 &label incremental_volume
152 &label vinc
153 & usage: exec vinc ARG1
154 & ARG1 = the operator's initials
155 &
156 &if [not [exists argument &r2]] &then &goto error
157 sc_command r vinc incremental_volume_dump -control sys_vols -operator &r2  -error_on -auto &rf3
158 &quit
159 &
160 &label consolidated_volume
161 &label vcons
162 &
163 & exec_com to allow the operators to easily run consolidated volume dumping.
164 &
165 & ARG1 = the operator's initials
166 &
167 &
168 &if [not [exists argument &r2]] &then &goto error
169 sc_command login Volume_Dumper Daemon vcons
170 pause 10
171 sc_command r vcons consolidated_volume_dump -control sys_vols -operator &r2 -error_on -auto -purge_volume_log &rf3
172 &quit
173 &
174 &label vcomp
175 &label complete_volume
176 & usage: exec vcomp ARG1
177 & ARG1 = the operator's initials
178 &
179 &if [not [exists argument &r2]] &then &goto error
180 sc_command login Volume_Dumper Daemon vcomp
181 pause 10
182 sc_command r vcomp complete_volume_dump -control sys_vols -operator &r2  -error_on -auto &rf3
183 &quit
184 &
185 &
186 & -----------------------------------------------------------------
187 & Incremental and Catchup Dumps
188 &
189 &label inc
190 & usage: exec inc ARG1 ARG2
191 & ARG1 = the operator's initials
192 & ARG2 = the first tape to be used
193 &
194 &if [not [exists argument &r3]] &then &goto error
195 sc_command r bk start_dump sys_dirs &r2 1 60
196 sc_command r bk &r3
197 &quit
198 &
199 &label cat
200 &
201 & exec_com to allow the operators to easily run catchup dumping.
202 &
203 & usage: exec cat ARG1 ARG2 -ARG3 ARG4-
204 &
205 & ARG1 = the operator's initials
206 & ARG2 = the first tape to be used
207 & ARG3 ARG4 (optional) = the date/time from which to start dumping (03/29/73 0800.0)
208 &
209 & example:  exec cat JW CAT21 03/29/73 0800.
210 &
211 &if [not [exists argument &r3]] &then &goto error
212 &if [exists argument &r4] &then sc_command r bk catchup_dump sys_dirs &r2 1 60  [string &r4 &r5]
213 &else sc_command r bk catchup_dump sys_dirs &r2 1 60
214 sc_command r bk &r3
215 &quit
216 &
217 & ------------------------------------------------------------
218 &
219 & hierarchy complete dumps
220 &
221 & USAGE: x comp INITIALS CONTROL_FILE TAPE_REEL
222 &
223 &label complete
224 &label comp
225 &
226 value_set -pp exec.cd_retry_count 0
227 &if [exists argument &r4] &then &goto .complete_args_ok
228 &print x complete: USAGE: x comp INITIALS CONTROL_FILE TAPE_REEL
229 &                                &2       &3           &4
230 &goto error
231 &label .complete_args_ok
232 &if [exists argument [as_who Dumper.SysDaemon -daemon -channel cd]] &then &goto .complete_logged_in
233 &label .retry_complete_login
234 &if [nless [value_get -pp exec.cd_retry_count] 3] &then &goto .complete_login
235 &print x complete: failed 3 tries to login Dumper.SysDaemon cd.
236 &goto error
237 &label .complete_login
238 value_set -pp exec.cd_retry_count -add 1
239 sc_command login Dumper.SysDaemon cd
240 pause 5
241 &goto .complete_args_ok
242 &label .complete_logged_in
243 sc_command r cd complete_dump -control &r3 -operator &r2
244 sc_command r cd &r4
245 &quit
246 &
247 & ------------------------------------------------------------
248 &
249 & WAKEUP_DUMP will wakeup the volume or hierarchy incremental
250 &
251 & USAGE: x wakeup_dump MC_SOURCE
252 &
253 &label wakeup_dump
254 &if [exists argument &r2] &then &goto .wakeup_args_ok
255 &print x wakeup_dump: USAGE: x wakeup_dump vinc|bk
256 &goto error
257 &label .wakeup_args_ok
258 &if [not [equal &r2 bk]] &then &goto .wakeup_not_bk
259 &if [not [exists argument [as_who -channel bk -daemon]]] &then &goto .wakeup_no_daemon
260 sc_command r bk wakeup_dump
261 &quit
262 &label .wakeup_not_bk
263 &if [not [equal &r2 vinc]] &then &goto .wakeup_not_vinc
264 &if [not [exists argument [as_who -channel vinc -daemon]]] &then &goto .wakeup_no_daemon
265 sc_command r vinc wakeup_volume_dump
266 &quit
267 &label .wakeup_not_vinc
268 &print x wakeup_dump: argument must be vinc or bk, not &r2.
269 &goto error
270 &label .wakeup_no_daemon
271 &print x wakeup_dump: No daemon logged in on source &rf2.
272 &goto error
273 & ------------------------------------------------------------
274 &
275 & END_DUMP will end the volume or hierarchy incremental
276 &
277 & USAGE: x end_dump MC_SOURCE
278 &
279 &label end_dump
280 &if [exists argument &r2] &then &goto .end_args_ok
281 &print x end_dump: USAGE: x end_dump vinc|bk
282 &goto error
283 &label .end_args_ok
284 &if [not [equal &r2 bk]] &then &goto .end_not_bk
285 &if [not [exists argument [as_who -channel bk -daemon]]] &then &goto .end_no_daemon
286 sc_command r bk end_dump
287 &quit
288 &label .end_not_bk
289 &if [not [equal &r2 vinc]] &then &goto .end_not_vinc
290 &if [not [exists argument [as_who -channel vinc -daemon]]] &then &goto .end_no_daemon
291 sc_command r vinc end_volume_dump
292 &quit
293 &label .end_not_vinc
294 &print x end_dump: argument must be vinc or bk, not &r2.
295 &goto error
296 &label .end_no_daemon
297 &print x end_dump: No daemon logged in on source &r2.
298 &goto error
299 &
300 & -----------------------------------------------------------------
301 & Things related to FDUMP processing.
302 &
303 &label copy_dump
304 &
305 & This exec is used to copy an FDUMP from the dump
306 & partition into the Multics hierarchy (in >dumps).
307 & This operation is not needed usually since system_start_up.ec does it.
308 &
309 copy_dump
310 &quit
311 &
312 &label set_fdump_number
313 &label set_fdump
314 &label sfdn
315 &
316 & This exec is used to set the ERF number of the next
317 & FDUMP to be taken to a specified value.
318 &
319 copy_dump$set_fdump_number &r2
320 &quit
321 &
322 &label delete_dump
323 &label dd
324 &
325 & exec_com to delete a dump
326 &
327 &if [exists argument &r2] &then &else &print delete_dump: missing dump_number
328 &if [exists argument &r2] &then &else &quit
329 deleteforce >dumps>*.*.*.&r2.**
330 &quit
331 &
332 &
333 &
334 & -----------------------------------------------------------------
335 & Sometimes the tabs on the TN300 get destroyed by an operator
336 & who types without waiting for the OPER: message.
337 & This will put the tabs back.
338 &
339 &label reset_tabs
340 &label tabs
341 &label rt
342 &
343 &command_line off
344 set_tty -terminal_type TN300 -tabs
345 &quit
346 &
347 & -----------------------------------------------------------------
348 &
349 &label echoplex
350 &
351 & Exec_com to allow operator to switch terminal into full (echoplex) duplex mode.
352 &
353 & Usage: x echoplex  (to set the terminal to echoplex mode)
354 &        x echoplex ^ (to turn off echoplex mode)
355 &
356 &
357 set_tty -modes &r2echoplex
358 &quit
359 &
360 & -----------------------------------------------------------------
361 & exec_coms to set and reset access on phcs_
362 &
363 &label set_phcs_access
364 &label spa
365 hpsa >system_library_1>phcs_ re &r2
366 &quit
367 &
368 &label reset_phcs_access
369 &label rpa
370 hpda >system_library_1>phcs_ &r2
371 &quit
372 &
373 & -----------------------------------------------------------------
374 & exec_com to setup the system in preparation for a metering run.
375 &
376 &
377 &label meter
378 &
379 sc_command quit nw
380 sc_command quit ns
381 sc_command logout IO * *
382 sc_command r bk logout
383 sc_command r mt setup
384 pause 10
385 & Give time for Network_Daemon and Network_Server to receive the quits
386 sc_command r nw logout
387 sc_command r ns logout
388 sc_command abs start 40 1
389 &print ********* Make sure all Daemons (except Metering) are logged out and then "r mt run" **********
390 &quit
391 &
392 & ==========================================================================================
393 &
394 &         ec to perform salvaging/quota validation
395 &         B. Greenberg 9/13/76
396 &
397 & Usage:  ec admin repair salv      dirname nprocs salvargs   for dir salvage
398 & Usage:  ec admin repair quota     dirname nprocs            for quota-used correction
399 & Usage:  ec admin repair salvquota dirname nprocs salvargs   for both.
400 & Usage:  ec admin repair stop                                kill multiprocessing.
401 &                  &1     &2        &3      &4     &5
402 &
403 &
404 
405 &label repair
406 &command_line off
407 &if [not [exists argument &r2]] &then &goto repair.explsalvctl
408 &if [equal &r2 stop] &then &goto repair.stop
409 &if [or [exists argument &r5] [not [exists argument &r4]]] &then &goto repair.explsalvctl
410 ec &ec_dir>&ec_name &rf1 -compact
411 &quit
412 &label repair.explsalvctl
413 &if [nless &n 4] &then &goto repair.usage
414 &if [nequal [verify &r4 0123456789] 0] &then &else &goto repair.badnprocs
415 &if [nequal &r4 0] &then &goto repair.badnprocs
416 &if [nless &r4 37] &then &goto repair.nprocsok
417 &label repair.badnprocs
418 &print admin.ec Number of processes (&4) is not number from 1 to 36.
419 &goto repair.usage
420 &
421 &label repair.nprocsok
422 &
423 &if [equal &r2 salv] &then &goto repair.1
424 &if [equal &r2 quota] &then &goto repair.1
425 &if [equal &r2 salvquota] &then &goto repair.1
426 &print admin.ec: invalid argument &r2 given to x repair
427 &label repair.usage
428 &print Usage: x repair salv/quota/salvquota dirname nprocs
429 &print Or: x repair stop, to log out processes
430 &quit
431 &label repair.1
432 &if [equal &r2 salv]
433 &then ec &ec_dir>&ec_name repair.2  "salvage_dir &r(1) &r(2).salvout &rf5" ""  &r3 &r4
434 &if [equal &r2 quota]
435 &then ec &ec_dir>&ec_name repair.2 "" "fix_quota_used &r(1)" &r3 &r4
436 &if [equal &r2 salvquota]
437 &then ec &ec_dir>&ec_name repair.2 "salvage_dir &r(1) &r(2).salvout &rf5" "fix_quota_used &r(1)" &r3 &r4
438 &quit
439 &label repair.2
440 &command_line off
441 &
442 &         This is an internal interface used by x repair.
443 &
444 & Usage:  ec admin repair.2 topdown_comline bottomup_comline dirname nprocs
445 &                  &1       &2              &3               &4      &5
446 &
447 &
448 &if [equal &r4 >] &then &goto repair.3
449 &  exists af doesnt like >.
450 &if [exists directory &r4] &then &goto repair.3
451 &print admin.ec: &r4 is not a directory.
452 &quit
453 
454 &label repair.3
455 dl >user_dir_dir>SysDaemon>Salvager>dos_mp_seg -brief
456 sc_command login Salvager SysDaemon s0
457 &if [nequal &r5 1] &then &else sc_command login Salvager SysDaemon s([index_set [minus &r5 1]])
458 pause 10
459 & It is illegal for both the top-down and bottom-up command lines to be null.
460 & If top-down command line is null, do the bottom-up command line.
461 &if [equal "" &r2]
462 &then sc_command reply s0 do_subtree """&q4""" -bu """&q3""" -priv -mp
463 & If bottom-up command line is null, do the top-down command line.
464 &if [equal "" &r3]
465 &then sc_command reply s0 do_subtree """&q4""" -td """&q2""" -priv -mp
466 & If neither is null, do both top-down and bottom-up command lines.
467 &if [and [not ([equal "" (&r2 &r3)])]]
468 &then sc_command reply s0 do_subtree """&q4""" -td """&q2""" -bu """&q3""" -priv -mp
469 & In the three command lines above, the arguments to do_subtree must be
470 & doubly-quoted to insure that the command lines are seen by do_subtree as
471 & a single argument, and to prevent the operator from including random
472 & command fragments in the directory pathname.  Double quotes are required
473 & because the command_processor_ removes one level of quotes when processing
474 & the sc_command.  Thus, do_subtree only sees one level of quoting.
475 & Note that processing of the reply request does NOT remove a level of quotes.
476 &
477 &quit
478 &label repair.stop
479 sc_command login Salvager SysDaemon s99
480 &quit
481 & ================================================================================================
482 &
483 &        ec to deny device to a process
484 &
485 &label deny
486 &command_line off
487 &
488 & Usage:   x deny <devname>
489 &
490 &if [exists argument &r2] &then ur &r2 -am
491 &else &print admin.ec: no device name given to x deny.
492 &quit
493 &
494 & ==========================================================================================
495 &
496 &         ec to authenticate a tape or disk device
497 &
498 &label auth
499 &command_line off
500 &if [exists argument &r3] &then authenticate_device &rf2
501 &else &print admin.ec: Usage: x auth devname AUTH
502 &quit
503 & =========================================================================================
504 &
505 &         ec to give response via the opr_query_response facility
506 &
507 &label oqr
508 &command_line off
509 &if [exists argument &r2] &then opr_query_response &rf2
510 &else &print admin.ec: Usage: x oqr response
511 &quit
512 & =========================================================================================
513 &
514 &
515 & ===========================================================================================
516 &
517 &   x scav {scavenge_vol args}
518 &
519 & ===========================================================================================
520 
521 &label scav
522 &command_line off
523 ec &ec_dir>admin_1 &rf1
524 &quit
525 & =========================================================================================
526 &
527 & Come here if there is a missing argument.
528 &
529 &label error
530 &print --------->>>> ERROR in &1. Missing argument. <<<<<--------
531 &quit
532 
533 & *****************************************************************************
534 &
535 & END OF ADMINISTRATIVE EXEC COM
536 & The following will catch any call not included above.
537 &
538 & This will invoke admin_dsa.ec for all "x FUNCTIONS ..." not found above
539 & in this exec_com.  It will complain if it doesn't implement the requested
540 & FUNCTION.  If DSA is not installed, then complain here.
541 &
542 &label &1
543 &if [exists segment >site>dsa>ecs>admin_dsa.ec]
544 &then exec_com >site>dsa>ecs>admin_dsa &rf1
545 &else &goto admin.bad_exec_arg
546 &quit
547 &
548 &label admin.bad_exec_arg
549 &print Invalid argument "&1" given to "exec".
550 &quit