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