home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #26 / NN_1992_26.iso / spool / comp / os / vms / 17934 < prev    next >
Encoding:
Internet Message Format  |  1992-11-14  |  14.6 KB

  1. Path: sparky!uunet!ukma!darwin.sura.net!zaphod.mps.ohio-state.edu!cis.ohio-state.edu!ucbvax!DCD00.FNAL.GOV!LAURI
  2. From: LAURI@DCD00.FNAL.GOV (Laurelin of Middle Earth, x2214)
  3. Newsgroups: comp.os.vms
  4. Subject: SETPQL  1/9
  5. Message-ID: <921113111504.20800159@fndcd.fnal.gov>
  6. Date: 13 Nov 92 17:15:04 GMT
  7. Sender: daemon@ucbvax.BERKELEY.EDU
  8. Distribution: world
  9. Organization: The Internet
  10. Lines: 335
  11.  
  12. $! ------------------ CUT HERE -----------------------
  13. $ v='f$verify(f$trnlnm("SHARE_VERIFY"))'
  14. $!
  15. $! This archive created by VMS_SHARE Version 7.2-007  22-FEB-1990
  16. $!   On 13-NOV-1992 10:55:48.53   By user LAURI 
  17. $!
  18. $! This VMS_SHARE Written by:
  19. $!    Andy Harper, Kings College London UK
  20. $!
  21. $! Acknowledgements to:
  22. $!    James Gray       - Original VMS_SHARE
  23. $!    Michael Bednarek - Original Concept and implementation
  24. $!
  25. $!+ THIS PACKAGE DISTRIBUTED IN 9 PARTS, TO KEEP EACH PART
  26. $!  BELOW 30 BLOCKS
  27. $!
  28. $! TO UNPACK THIS SHARE FILE, CONCATENATE ALL PARTS IN ORDER
  29. $! AND EXECUTE AS A COMMAND PROCEDURE  (  @name  )
  30. $!
  31. $! THE FOLLOWING FILE(S) WILL BE CREATED AFTER UNPACKING:
  32. $!       1. [.SETPQL_V2_0]AAAREADME.TXT;3
  33. $!       2. [.SETPQL_V2_0]BUILD.COM;1
  34. $!       3. [.SETPQL_V2_0]SETPQL.C;1
  35. $!       4. [.SETPQL_V2_0]SETPQL.HLP;1
  36. $!       5. [.SETPQL_V2_0]SETPQL_CLD.CLD;1
  37. $!       6. [.SETPQL_V2_0]SETPQL_MSG.MSG;1
  38. $!
  39. $set="set"
  40. $set symbol/scope=(nolocal,noglobal)
  41. $f=f$parse("SHARE_TEMP","SYS$SCRATCH:.TMP_"+f$getjpi("","PID"))
  42. $e="write sys$error  ""%UNPACK"", "
  43. $w="write sys$output ""%UNPACK"", "
  44. $ if f$trnlnm("SHARE_LOG") then $ w = "!"
  45. $ ve=f$getsyi("version")
  46. $ if ve-f$extract(0,1,ve) .ges. "4.4" then $ goto START
  47. $ e "-E-OLDVER, Must run at least VMS 4.4"
  48. $ v=f$verify(v)
  49. $ exit 44
  50. $UNPACK: SUBROUTINE ! P1=filename, P2=checksum
  51. $ if f$search(P1) .eqs. "" then $ goto file_absent
  52. $ e "-W-EXISTS, File ''P1' exists. Skipped."
  53. $ delete 'f'*
  54. $ exit
  55. $file_absent:
  56. $ if f$parse(P1) .nes. "" then $ goto dirok
  57. $ dn=f$parse(P1,,,"DIRECTORY")
  58. $ w "-I-CREDIR, Creating directory ''dn'."
  59. $ create/dir 'dn'
  60. $ if $status then $ goto dirok
  61. $ e "-E-CREDIRFAIL, Unable to create ''dn'. File skipped."
  62. $ delete 'f'*
  63. $ exit
  64. $dirok:
  65. $ w "-I-PROCESS, Processing file ''P1'."
  66. $ if .not. f$verify() then $ define/user sys$output nl:
  67. $ EDIT/TPU/NOSEC/NODIS/COM=SYS$INPUT 'f'/OUT='P1'
  68. PROCEDURE Unpacker ON_ERROR ENDON_ERROR;SET(FACILITY_NAME,"UNPACK");SET(
  69. SUCCESS,OFF);SET(INFORMATIONAL,OFF);f:=GET_INFO(COMMAND_LINE,"file_name");b:=
  70. CREATE_BUFFER(f,f);p:=SPAN(" ")@r&LINE_END;POSITION(BEGINNING_OF(b));
  71. LOOP EXITIF SEARCH(p,FORWARD)=0;POSITION(r);ERASE(r);ENDLOOP;POSITION(
  72. BEGINNING_OF(b));g:=0;LOOP EXITIF MARK(NONE)=END_OF(b);x:=ERASE_CHARACTER(1);
  73. IF g=0 THEN IF x="X" THEN MOVE_VERTICAL(1);ENDIF;IF x="V" THEN APPEND_LINE;
  74. MOVE_HORIZONTAL(-CURRENT_OFFSET);MOVE_VERTICAL(1);ENDIF;IF x="+" THEN g:=1;
  75. ERASE_LINE;ENDIF;ELSE IF x="-" THEN IF INDEX(CURRENT_LINE,"+-+-+-+-+-+-+-+")=
  76. 1 THEN g:=0;ENDIF;ENDIF;ERASE_LINE;ENDIF;ENDLOOP;t:="0123456789ABCDEF";
  77. POSITION(BEGINNING_OF(b));LOOP r:=SEARCH("`",FORWARD);EXITIF r=0;POSITION(r);
  78. ERASE(r);x1:=INDEX(t,ERASE_CHARACTER(1))-1;x2:=INDEX(t,ERASE_CHARACTER(1))-1;
  79. COPY_TEXT(ASCII(16*x1+x2));ENDLOOP;WRITE_FILE(b,GET_INFO(COMMAND_LINE,
  80. "output_file"));ENDPROCEDURE;Unpacker;QUIT;
  81. $ delete/nolog 'f'*
  82. $ CHECKSUM 'P1'
  83. $ IF CHECKSUM$CHECKSUM .eqs. P2 THEN $ EXIT
  84. $ e "-E-CHKSMFAIL, Checksum of ''P1' failed."
  85. $ ENDSUBROUTINE
  86. $START:
  87. $ create 'f'
  88. X   Product name : SETPQL
  89. X        Version : 2.0
  90. X           Date : November 1992
  91. X  Origin/Author : L. Loebel, Computing Division, Fermilab (lauri@fnal.fnal.g
  92. Vov)
  93. X
  94. XDescription:
  95. X
  96. X        SETPQL is a utility designed for system managers in order to make
  97. X        sure that all users in the SYSUAF file have the minimum recommended
  98. X        process quota limits.  Frequently a new release of VMS or other
  99. X        layered products will require that certain quotas be raised.  The
  100. X        system manager may modify the DEFAULT account, but not each
  101. X        individual user.  Or, the system manager may know that some users
  102. X        already exceed this minimum value, and do not wish to do a global
  103. X        change for all users lest some have their quotas reduced.  SETPQL is
  104. X        designed so that it will only RAISE PQL values, never lower them.
  105. X
  106. X        SYSUAF uses $RMS calls to read the SYSUAF file to obtain each
  107. X        username on the system.  (Unfortunately, there is no "supported"
  108. X        wildcard method of obtaining this list via system service calls).`20
  109. X        $GETUAI and $SETUAI are used to read/modify the process quotas for
  110. X        users who do NOT meet the minimum specified on the command line (or
  111. X        in the DEFAULT account).  The /NOMODIFY qualifier may be used if you
  112. X        wish to only *look* at the account quotas, i.e., to check things
  113. X        before you actually make changes.
  114. X`20
  115. X        The file BUILD.COM may be used to compile and link the modules that
  116. X        form the SETPQL.EXE image.  SETPQL is written in VAX-C and requires
  117. X        a C compiler.`20
  118. X`20
  119. X        The file SETPQL.HLP contains all of the information on the options
  120. X        available with the SETPQL command.  This is the most complete
  121. X        documentation source.
  122. X
  123. XUsage:
  124. X`09$ SETPQL :== "$ dev:`5Bdir`5DSETPQL.EXE"`09! wherever it is located
  125. X`09$ SETPQL `5B/options`5D
  126. X
  127. X
  128. XFiles included in this VMS_SHARE kit:
  129. X
  130. X`09AAAREADME.TXT          - this file.
  131. X`09BUILD.COM              - creates the .EXE from the source modules.
  132. X`09SETPQL.C               - primary C source code file.
  133. X`09SETPQL_CLD.CLD         - command language definition module.
  134. X`09SETPQL_MSG.MSG         - error message definition module.
  135. X`09SETPQL.HLP             - primary documentation source.
  136. X
  137. $ CALL UNPACK [.SETPQL_V2_0]AAAREADME.TXT;3 394231135
  138. $ create 'f'
  139. X$!
  140. X$! build the SETPQL images from scratch
  141. X$! in the current directory.
  142. X$!
  143. X$ set verify
  144. X$ on warning then goto exit
  145. X$ message setpql_msg`09`09`09! error message definition
  146. X$ set command setpql_cld/object`09`09! command language definition
  147. X$ cc setpql`09`09`09`09! source code
  148. X$ link/notrace -`09`09`09! prevent stack dumps on warning msg.
  149. X`09setpql, setpql_cld, setpql_msg, sys$input/options
  150. X`09sys$share:vaxcrtl/share
  151. X$ exit:
  152. X$ exit`09! 'f$verify(0)
  153. $ CALL UNPACK [.SETPQL_V2_0]BUILD.COM;1 1362640472
  154. $ create 'f'
  155. X/***************************************************************************
  156. V***/
  157. X/*                                SETPQL.C
  158. V                                    */
  159. X/***************************************************************************
  160. V***/
  161. X/* Author: Lauri Loebel, Computing Division, Fermilab
  162. V                         */
  163. X/***************************************************************************
  164. V***/
  165. X/****************************Copyright Notice*******************************
  166. V***/
  167. X/*             Copyright `A91991 Universities Research Association, Inc.
  168. V        */
  169. X/*                         All Rights Reserved
  170. V                                */
  171. X/***************************************************************************
  172. V***/
  173. X/***********************Government Sponsorship Notice***********************
  174. V***/
  175. X/*This material resulted from work developed under a Government Contract and
  176. V  */
  177. X/*is subject to the following license:  The Government retains a paid-up,
  178. V     */
  179. X/*nonexclusive, irrevocable worldwide license to reproduce, prepare derivati
  180. Vve*/
  181. X/*works, perform publicly and display publicly by or for the Government,
  182. V      */
  183. X/*including the right to distribute to other Government contractors.  Neithe
  184. Vr */
  185. X/*the United States nor the United States Department of Energy, nor any of
  186. V    */
  187. X/*their employees, makes any warrenty, express or implied, or assumes any
  188. V     */
  189. X/*legal liability or responsibility for the accuracy, completeness, or
  190. V        */
  191. X/*usefulness of any information, apparatus, product, or process disclosed, o
  192. Vr */
  193. X/*represents that its use would not infringe privately owned rights.
  194. V          */
  195. X/***************************************************************************
  196. V***/
  197. X/*
  198. X/* General description: Purpose, Usage, Algorithm.
  199. X/*
  200. X/* Purpose:
  201. X/*
  202. X/* To make sure that all accounts in the SYSUAF file meet minimum Process
  203. X/* Quota Limits (specified by the person running the SETPQL program).`20
  204. X/* Frequently, VMS upgrades recommend that the various process quota limits
  205. X/* (ASTLM, MAXDETACH, BYTLM, etc.) for all accounts be raised to some new
  206. X/* value; or the addition of a new software package will require that PQL
  207. X/* values be raised.  Some records in the SYSUAF file may (for whatever
  208. X/* reason) already exceed the minimum recommendatations; therefore, a
  209. X/* wildcard MODIFY within AUTHORIZE may not be wise (it will REDUCE pql
  210. X/* values for those accounts which already exceeded the given value).  This
  211. X/* program is designed to ONLY RAISE, never lower, process quota limits for
  212. X/* specified accounts in SYSUAF.  The default is to check *all* accounts.
  213. X/*
  214. X/* The minimum values for the various process quota limits are taken either
  215. X/* from:
  216. X/* `09- explicit values entered on the command line
  217. X/* `09- values given in SYSUAF for the DEFAULT account
  218. X/* Command line values take precedence over the DEFAULT account values.
  219. X/*
  220. X/* Usage:
  221. X/*
  222. X/* To use the SETPQL.EXE excutable, define a foreign command symbol which
  223. X/* points to the location of the executable image:
  224. X/*
  225. X/* `09`09$ setpql :== "$ device:`5Bdir`5Dsetpql.exe"
  226. X/*
  227. X/* The command is then invoked:
  228. X/*
  229. X/*`09`09$ setpql `5B/qualifiers`5D  `5Buserlist`5D
  230. X/*
  231. X/* where userlist is the list of usernames you wish to check.  Wildcards are
  232. X/* allowed; the default if no userlist is specified is to check all users`20
  233. X/* (i.e., default userlist = "*").
  234. X/*
  235. X/* The legal qualifiers with this command are:
  236. X/*
  237. X/* /`5BNO`5DEXCLUDE
  238. X/*`09/EXCLUDE=( `5BFILE `5B=exclude-file`5D`5D `5B,USER=(userlist)`5D )
  239. X/*`09`09- Do `5BNOT`5D exclude certain accounts from the scan.
  240. X/*`09`09  Default is /EXCLUDE=FILE=SETPQL_EXCLUDE.  The SETPQL_EXCLUDE
  241. X/*`09`09  file will be selected based on:
  242. X/*`09`09`09a) a logical name which points to a file, if this
  243. X/*`09`09`09   exists,`20
  244. X/*`09`09`09b) a SETPQL_EXCLUDE.DAT file in the current default
  245. X/*`09`09`09   directory, if this exists,
  246. X/*`09`09`09c) a SETPQL_EXCLUDE.DAT file in the current user's
  247. X/*`09`09`09   SYS$LOGIN directory, if this exists.
  248. X/*`09`09  If no SETPQL_EXCLUDE file is found, the program will`20
  249. X/*`09`09  issue an information message and continue.
  250. X/*
  251. X/*`09`09  The SETPQL_EXCLUDE file may contain comments (anything
  252. X/*`09`09  following the "!" character).  It should contain a list
  253. X/*`09`09  of USERNAMEs which should be excluded from the scan.
  254. X/*`09`09  The list may contain wildcards.  You may include more
  255. X/*`09`09  than one username per line, delimited by spaces or
  256. X/*`09`09  commas.  NOTE that these must be userNAMEs, not
  257. X/*`09`09  UIC specifications.
  258. X/*
  259. X/*`09`09  You may also explicitly exclude usernames with the
  260. X/*`09`09  form /EXCLUDE=USER=(userlist).  This list may contain
  261. X/*`09`09  wildcards.  Users may be specified by name or by UIC
  262. X/*`09`09  specification.
  263. X/*
  264. X/*`09`09  You may combine these two, as in:
  265. X/*`09`09    $ SETPQL/EXCLUDE=( FILE,  -
  266. X/*`09`09`09`09 `09USER=( *$SERVER, `5BSYS*,*`5D ) )
  267. X/*
  268. X/*
  269. X/* /`5BNO`5DLOG`09- Do `5BNOT`5D log to the SYS$OUTPUT device any informatio
  270. Vn
  271. X/* `09`09  regarding the status of accounts (e.g., which accounts
  272. X/* `09`09  would be modified and how).
  273. X/* `09`09  Default is /LOG.
  274. X/*
  275. X/* /`5BNO`5DMODIFY`09- Do `5BNOT`5D modify the SYSUAF file, merely tell us w
  276. Vhat
  277. X/* `09`09  *WOULD* have been changed.
  278. X/* `09`09  Default is /MODIFY.
  279. X/*
  280. X/* /`5BNO`5DALL`09- Examine all of the PQL parameters.  /NOALL is the defaul
  281. Vt;
  282. X/* `09`09  it implies that only those parameters specifically listed
  283. X/* `09`09  on the command line should be examined.
  284. X/*
  285. X/* Additionally, each PQL in the SYSUAF file has it's own qualifier.  One
  286. X/* example will suffice:
  287. X/*
  288. X/* /`5BNO`5DASTLM`5B=astvalue`5D
  289. X/* `09`09- The /NOASTLM qualifier would specifically request that
  290. X/* `09`09  the ASTLM field be excluded from examination, i.e.,`20
  291. X/* `09`09  ASTLM would be ignored completely.
  292. X/* `09`09  The /ASTLM qualifier by itself would request that`20
  293. X/* `09`09  the specified users' ASTLM be raised (if necessary) to the value
  294. X/* `09`09  of ASTLM for the DEFAULT account.
  295. X/* `09`09  If an astvalue is specified, as in /ASTLM=500, then
  296. X/* `09`09  the value of 500 will be used for all accounts,
  297. X/* `09`09  overriding the DEFAULT account ASTLM.
  298. X/*
  299. X/* The following qualifiers operate in the same manner:
  300. X/* /BIOLM, /BYTLM, /CPUTIME, /DIOLM, /ENQLM, /FILLM, /JTQUOTA, /MAXACCTJOBS,
  301. X/* /MAXDETACH, /MAXJOBS, /PBYTLM, /PGFLQUOTA, /PRCLM, /PRIO, /QUEPRIO,`20
  302. X/* /SHRFILLM, /TQELM, /WSDEFAULT, /WSEXTENT, /WSQUOTA
  303. X/*
  304. X/* NOTE that /CPUTIME is specified as a DELTA-TIME, that is, in the standard
  305. X/* VMS format of "dddd-hh:mm:ss.cc".
  306. X/*
  307. X/* NOTE also that in some cases, a value of 0 implies that the PQL is actual
  308. Vly
  309. X/* infinite.  These are considered; that is, 0 is taken to be a higher value
  310. X/* than any other positive value for these quotas.
  311. X/*
  312. X/* Algorithm:
  313. X/*  `20
  314. X/* A structure to hold all of the various PQL values is declared.  Because
  315. X/* of the different data types of PQL values, the variables within this stru
  316. Vcture
  317. X/* are of different data types (short, long, char, etc.).  For this reason,
  318. V the
  319. X/* values cannot merely be placed in an array.
  320. X/*  `20
  321. X/* An array of addresses which point to the PQL values is declared.  This is
  322. X/* actually a union of different pointer types (short *, long *, char *).`20
  323. X/* these addresses point to the actual PQL values.
  324. X/*
  325. X/* An auxiliary array structure, Info, is declared.  This contains
  326. X/* information on: the textual description of each parameter, whether or not
  327. X/* it was specified on the command line and should be examined, the value
  328. X/* specified on the command line, the data type of each particular process
  329. X/* quota value.  It also holds any flags for special processing of certain
  330. X/* parameters (e.g., cputime or uic).
  331. X/*
  332. X/* The command line is parsed.  The $GETUAI system service is used to
  333. X/* determine the pql values for the DEFAULT account.  These values are
  334. X/* compared with the values entered on the command line; the higher of the
  335. X/* two values is used.  The MasterValue structure is populated with the PQL
  336. X/* values which are to be used.  NOTE that only those PQL values which were
  337. X/* specified on the command line are examined; the others are ignored.
  338. X/*
  339. X/* The SYSUAF file is opened for indexed read access.  A DO-LOOP is entered:
  340. X/* Read the next SYSUAF file to get the next username.  Call $GETUAI to
  341. X/* determine all of this user's PQL values.  For those that we were instruct
  342. Ved
  343. X/* to examine, compare with the MasterValues and select the highest value.
  344. X/* (For those that were not specified on the command line, do nothing, leave
  345. +-+-+-+-+-+-+-+-  END  OF PART 1 +-+-+-+-+-+-+-+-
  346.  
  347.