1 :Info: copy_deadproc:  2022-12-05  copy_deadproc
  2 
  3 Syntax as a command:
  4   copy_deadproc DEADPROC_NAME {-ctl_args}
  5   copy_deadproc -name DEADPROC_NAME {-ctl_args}
  6 
  7 
  8 Function:  Gather information about a "dead process" and move its
  9 process directory to >dumps>saved_pdirs directory.  For more
 10 information, see the "Notes on a dead process" section below.
 11 
 12 
 13 Arguments:
 14    Either a DEADPROC_NAME or the -name control argument is required.
 15 DEADPROC_NAME
 16    is the name of the dead process directory to be copied.  If
 17    DEADPROC_NAME is not an absolute pathname, the default path is
 18    >process_dir_dir>DEADPROC_NAME.  All components of the
 19    DEADPROC_NAME must be given.  Such names have the format:
 20       PERSON_ID.PROJECT_ID.f.TTY_NAME
 21    For example:  Swenson.Multics.f.d.h003
 22 
 23 
 24 Control arguments:
 25 -name DEADPROC_NAME, -nm DEADPROC_NAME
 26    specifies the name of the dead process to be copied.
 27 -delete, -dl
 28    specifies that after the dead process is copied, the original
 29    directory in >process_dir_dir is deleted.  Status and modify access
 30    to the containing directory is needed.  If access is lacking, the
 31    user is queried about whether to continue copying.
 32 -no_delete, -ndl
 33    specifies do not delete the dead process directory after copying is
 34    complete.  This is the default.
 35 
 36 
 37 -owner, -ow
 38    specifies that the process owner's PERSON_ID.PROJECT_ID be given
 39    "s" access to the preserved directory.  This permits the owner to
 40    examine the directory using analyze_multics.  Otherwise, system
 41    administrator access is required to examine the preserved directory
 42    contents.
 43 
 44 
 45 Notes on a dead process:  Any process whose operation is terminated
 46 abnormally (e.g., termination by a "fatal process error") will be
 47 treated as a "dead process" if the process was owned by
 48 Person_ID.Project_ID and the following conditions are true at the time
 49 of process termination:
 50 
 51  - The system administrator has previously set the "save_pdir"
 52    attribute in the System Administration Table (SAT) entry for
 53    Project_ID.
 54 
 55  - The Project_ID project administrator has previously set the
 56    "save_pdir" attribute in Person_ID's entry within Project_ID's
 57    Project Definition Table (PDT).
 58 
 59 
 60 The Answering Service is notified whenever any process terminates; the
 61 notification includes a reason for termination.  The Answering Service
 62 normally deletes the process directory owned by the terminating
 63 process.  However, if termination was abnormal and the "save_pdir"
 64 attribute has been set as described above, then the Answering Service
 65 preserves the process directory by renaming it using a "dead process"
 66 name format:
 67   rn >pdd>!BPlDbdwbBBBBBB PERSON_ID.PROJECT_ID.f.TTY_NAME
 68 
 69 Information contained in the "dead process" name format plus the
 70 date-time-entry-modified on the renamed process directory serve to
 71 identify ownership of directory contents and date_time of its
 72 termination.
 73 
 74 
 75 Notes on using copy_deadproc:  After the Answering Service has renamed
 76 the process directory for the "dead process", a copy_deadproc command
 77 can save this dead process directory to a protected location where it
 78 may be examined using the analyze_multics (azm) tool.  This command
 79 annotates contents of the process directory, and moves it to the
 80 preserving location with the new name:
 81   mvd >pdd>PERSON_ID.PROJECT_ID.f.TTY_NAME >dumps>saved_pdirs>=.=.pdir
 82 
 83 If a PERSON_ID.PROJECT_ID.pdir directory already exists at that
 84 location, it is first renamed to:
 85    PERSON_ID.PROJECT_ID.N.pdir
 86 where N=1 before moving the latest dead process directory.  Similar
 87 renaming occurs if directories with higher values of N already exist
 88 in the saved_pdirs directory.
 89 
 90 
 91 Access to the copied pdir is determined by the directory initial ACL
 92 on the >dumps>saved_pdirs directory.  Access to segments within that
 93 directory does not change.
 94 
 95 Several hardcore segments needed by analyze_multics are also added to
 96 the directory.  Two such segments are: pdir_info and uid_hash_table
 97 which contain the annotations made by copy_deadproc.  These
 98 annotations are used by analyze_multics when translating segment
 99 numbers used by the dead process.  Any segments pointed to by links in
100 the dead proc directory are also copied in place of those links.
101 
102 
103 Access required:  Use of the copy_deadproc command requires access to
104 the phcs_ gate, as well as sma access on the >dumps>saved_pdirs
105 directory.  A user can copy his own dead process if he has "sma" on
106 the saved_pdirs directory and access to the >sl1>phcs_ gate.
107 
108 Access to the hphcs_ gate is needed if the dead process was not owned
109 by the person using the copy_deadproc command.
110 
111 Access to the system_privilege_ gate is needed when copying a dead
112 process which ran at a different authorization level than the process
113 doing the copying.  Such copying can only be done only by the system
114 administrator or security administrator.
115 
116 
117 :Info: copy_liveproc:  2022-12-05  copy_liveproc
118 
119 Syntax as a command:
120    copy_liveproc PROCESS_DIR_NAME PERSON_ID.PROJECT_ID {-ctl_args}
121 
122 
123 Function:  A "live process" is one which is still connected to the
124 user's terminal but has stopped responding to the user's inputs.  This
125 prevents the user from interrupting operation of the process to invoke
126 a debugger.
127 
128 A copy_liveproc command issued from another process can copy the
129 process directory for the "live process" to a protected location where
130 it may be examined using the analyze_multics (azm) tool.  This command
131 moves the process directory to:
132    >dumps>save_pdirs>PERSON_ID.PROJECT_ID.pdir
133 
134 
135 Arguments:
136    Either PROCESS_DIR_NAME and PERSON_ID.PROJECT_ID arguments may be
137    given, or -directory and -name control arguments may be used.
138 PROCESS_DIR_NAME
139    is the name of the live process directory to be copied.  If just
140    an entryname is given, it is assumed to be an entryname in >pdd
141    (i.e., >process_dir_dir>!BPbDbdxBBBBBBB).
142 PERSON_ID.PROJECT_ID
143    identifies the user owning the process.  This name is used
144    when creating the saved process directory, ending with a .pdir
145    standard suffix.
146 
147 
148 Control arguments:
149 -directory PROCESS_DIR_NAME, -dr PROCESS_DIR_NAME
150    specifies the name of the process directory to be saved.
151 -name PERSON_ID.PROJECT_ID,
152 -nm  PERSON_ID.PROJECT_ID
153    specifies the name of the user owning the process.
154 -owner, -ow
155    specifies that access be set appropriately so the owner of saved
156    directory can used analyze_multics himself to examine the hung
157    process.
158 
159 
160 Notes on using the copy_liveproc command:  The print_apt_entry (pae)
161 command/AF can be used to obtain the TTY_NAME and PROCESS_DIR_NAME for
162 a non-responding "live process" to be copied.  See "Examples" below.
163 
164 
165 The copy_liveproc command moves segments from the original process
166 directory of the "live process" to the protected location.  Do not use
167 copy_liveproc to copy your current process, or to copy any process
168 essential to system operation (such as the Initializer process).
169 Moving its process directory will abnormally terminate that process as
170 its stack or other essential segments are deleted.
171 
172 
173 If the copy_liveproc command discovers that an existing
174 PERSON_ID.PROJECT_ID.pdir directory in >dumps>saved_pdirs, that
175 existing directory is renamed to:
176   PERSON_ID.PROJECT_ID.N.pdir
177 where N=1 before copying the dead process directory.  Similar renaming
178 occurs if directories with high values of N already exist.
179 
180 Access to the copied pdir is determined by the initial_acl for
181 directories set for the >dumps>saved_pdirs directory.  Access on
182 segments within the directory does not change.
183 
184 
185 Several hardcore segments needed by analyze_multics are also copied
186 into the directory.  Two segments are:, pdir_info and uid_hash_table.
187 These are used by analyze_multics when examining the live process.
188 Any segments pointed to by links in the dead proc directory are also
189 copied in place of those links.
190 
191 
192 Access required:  Use of this command requires access to the phcs_
193 gate, as well as sma access on the >dumps>saved_pdirs directory.  A
194 user can copy his own process if he has "sma" on the saved_pdirs
195 directory and access to the >sl1>phcs_ gate.
196 
197 Access to the hphcs_ gate is needed if the dead process doesn't belong
198 to the process doing the copying.
199 
200 Access to the system_privilege_ gate is needed when copying a dead
201 process which ran at a different authorization level than the process
202 doing the copying.  Such copying can only be done only by the system
203 administrator or security administrator.
204 
205 
206 Examples:
207 A system administrator might preserve a non-responsive Backup
208 project directory using the command:
209   copy_liveproc [pae Backup -process_dir] Backup.SysDaemon
210 
211 
212 :hcom:
213 /****^  HISTORY COMMENTS:
214   1) change(2022-12-05,GDixon), approve(2023-01-16,MCR10129),
215      audit(2023-02-28,Swenson), install(2023-02-28,MR12.8-1054):
216       A) Merger copy_liveproc.info into this segment.
217       B) Add an "Access required" section to this info seg.
218       C) Revise and simplify the wording.
219       D) Repair problems found by verify_info.
220                                                    END HISTORY COMMENTS */
221