(go to: table of contents, index, list of vms_sys, prev: CRELNT, next: DACEFC)
Format:
The process quota list must be delivered to the Python interface as a
'tuple of tuples' - see the examples section below.
See the system services reference manual for explanations about quotas.
Bitmask values (PRC_M_name) for this argument are in module
'vms_prcdef'.
CREPRC - Create Process
Creates a subprocess or detached process on behalf of the calling
process.
24-MAR-1999 ZE.
pidadr = vms_sys.creprc ([image] ,[input] ,[output] ,[error] ,\
[prvadr] ,[quota] ,[prcnam] ,[baspri] ,\
[uic] ,[mbxunt] ,[stsflg] )
Returns:
Arguments:
Examples:
>>> import vms_sys
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE','CREPRC_1.COM',
... 'CREPRC_1.LOG', None, None, None, 'CREPRC_1P',3)
>>> l_pid
343
>>> import vms_lib
>>> vms_lib.getjpi ('JPI$_PRCNAM',l_pid)
(343, 'CREPRC_1P')
>>> # test done, remove process from system to clean up
>>> vms_sys.delprc (l_pid)
343 <-- DELPRC returns the PID - please look up
>>> # the description of DELPRC why this is so
$ type CREPRC_1.COM
$ show process/quota
$ wait 01:00:00
$ exit 1
$! -----
$ type CREPRC_1.LOG
$ show process/quota
15-OCT-1998 17:43:26.96 User: ZESSIN Process ID: 00000157
Node: HERE Process name: "CREPRC_1P"
Process Quotas:
Account name: HOME
CPU limit: Infinite Direct I/O limit: 100
Buffered I/O byte count quota: 121536 Buffered I/O limit: 100
Timer queue entry quota: 29 Open file quota: 297
Paging file quota: 36492 Subprocess quota: 9
Default page fault cluster: 64 AST quota: 99
Enqueue quota: 4000 Shared file limit: 0
Max detached processes: 0 Max active jobs: 0
$ wait 01:00:00
$!
----------------------------------------
>>> import vms_prcdef
>>> l_stsflg = vms_prcdef.PRC_M_DETACH + \
... vms_prcdef.PRC_M_NOUAF + \
... vms_prcdef.PRC_M_HIBER
>>> process_quota_list = ( ('PQL$_ENQLM',1111), ('PQL$_FILLM', 123) )
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, process_quota_list, 'CREPRC_1P',3,
... None, None, l_stsflg) # base priority -----^
>>>
>>> import vms_lib
>>> vms_lib.getjpi ('JPI$_ENQLM', l_pid)
(355, 1111)
>>> # ^^^^
>>> vms_lib.getjpi ('JPI$_FILLM', l_pid)
(355, 123)
>>> # ^^^
>>>
>>> hex(l_pid)
'0x163'
^^^------------------------------vvv
$! ----- !!!
$ show process/quota/identification=163
15-OCT-1998 19:14:24.80 User: ZESSIN Process ID: 00000163
Node: HERE Process name: "CREPRC_1P"
Process Quotas:
Account name: HOME
CPU limit: Infinite Direct I/O limit: 100
Buffered I/O byte count quota: 39872 Buffered I/O limit: 100
Timer queue entry quota: 8 Open file quota: 123
PQL$_FILLM set ------------------------------------------->^^^
Paging file quota: 31997 Subprocess quota: 8
Default page fault cluster: 64 AST quota: 100
Enqueue quota: 1111 Shared file limit: 0
PQL$_ENQLM set --------------->^^^^
Max detached processes: 0 Max active jobs: 0
$! -----
$ show process /identification=163
15-OCT-1998 19:17:04.13 User: ZESSIN Process ID: 00000163
Node: HERE Process name: "CREPRC_1P"
Terminal:
User Identifier: [HOME,ZESSIN]
Base priority: 3 <-- base priority set
Default file spec: Not available
$! -----
$ stop /identification=163
----------------------------------------
>>> # specify a different UIC
>>> l_uic = 0x120035 # [22,65]
>>> # show octal
>>> print oct(l_uic/65536), oct(l_uic & 0xffff)
022 065
>>>
>>> import vms_prcdef
>>> l_stsflg = vms_prcdef.PRC_M_DETACH + \
... vms_prcdef.PRC_M_NOUAF + \
... vms_prcdef.PRC_M_HIBER
>>>
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, None, 'CREPRC_1P',None,
... l_uic, None, l_stsflg)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_sys.error: (36, '%SYSTEM-F-NOPRIV, insufficient privilege\
or object protection violation')
$ set process/privilege=detach
>>>
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, None, 'CREPRC_1P',None,
... l_uic, None, l_stsflg)
>>> hex(l_pid)
'0x161'
>>>
$ show process/identification=161
16-OCT-1998 19:41:58.26 User: ZESSIN Process ID: 00000161
Node: HERE Process name: "CREPRC_1P"
Terminal:
User Identifier: [22,65]
Base priority: 0 <-- base priority was 'None'
Default file spec: Not available
$
----------------------------------------
>>> import vms_prvdef
>>> q_prvadr = vms_prvdef.PRV_M_ALLSPOOL + \
... vms_prvdef.PRV_M_DIAGNOSE + \
... vms_prvdef.PRV_M_BUGCHK
>>>
>>> # the privilege mask is a quadword,
>>> # which is represented by a Python long integer
>>> print q_prvadr
8388688L
>>>
>>> import vms_prcdef
>>> l_stsflg = vms_prcdef.PRC_M_DETACH + \
... vms_prcdef.PRC_M_NOUAF + \
... vms_prcdef.PRC_M_HIBER
>>>
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, q_prvadr, None, 'CREPRC_1P',3,
... None, 999, l_stsflg)
>>> hex (l_pid)
'0x160'
>>>
^^^------------------------------------vvv
$show process /privileges /identification=160
16-OCT-1998 19:24:23.48 User: ZESSIN Process ID: 00000160
Node: HERE Process name: "CREPRC_1P"
Authorized privileges:
ALLSPOOL BUGCHK DIAGNOSE
Process privileges:
ALLSPOOL may allocate spooled device
BUGCHK may make bug check log entries
DIAGNOSE may diagnose devices
Process rights:
INTERACTIVE
LOCAL
System rights:
SYS$NODE_HERE
$ analyze /system
VAX/VMS System analyzer
SDA> set process "CREPRC_1P"
Process index: 0020 Name: CREPRC_1P Extended PID: 00000160
--------------------------------------------------------------
Status : 001C0009 res,inquan,phdres,hiber,login
Status2: 00009800 class_scheduled,class_supplied,windfall
PCB address 815192C0 JIB address 8151DEC0
PHD address 81F09A00 Swapfile disk address 00000000
Master internal PID 00050020 Subprocess count 0
Internal PID 00050020 Creator internal PID 00000000
Extended PID 00000160 Creator extended PID 00000000
State HIB Termination mailbox 03E7
[...] vvv--------------------------------------------^^^^
SDA> evaluate 3E7
Hex = 000003E7 Decimal = 999 BUG$_SYSTRMERR+00007
SDA>
----------------------------------------
>>> process_quota_list = ( ('PQL$_FILLM', 123), ('PQL$_BAD_LM',1) )
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, process_quota_list, 'CREPRC_1P',3,
... None, None, None)
Traceback (innermost last):
File "<stdin>", line 1, in ?
ValueError: argument 6: quota-list - unknown quota code: PQL$_BAD_LM
>>>
----------------------------------------
>>> # a process name must be unique in a UIC group
>>>
>>> import vms_prcdef
>>> l_stsflg = vms_prcdef.PRC_M_DETACH + \
... vms_prcdef.PRC_M_NOUAF + \
... vms_prcdef.PRC_M_HIBER
>>>
>>> # start first process
>>> l_pid1 = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, None, 'CREPRC_TST',3,
... None, None, l_stsflg)
>>> hex(l_pid1)
'0x164'
>>> # try to start second process with same name
>>> l_pid2 = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, None, 'CREPRC_TST',3,
... None, None, l_stsflg)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_sys.error: (148, '%SYSTEM-F-DUPLNAM, duplicate name')
>>> # test done, remove first process from system to clean up
>>> vms_sys.delprc (l_pid1)
356 <-- DELPRC returns the PID - please look up
>>> # the description of DELPRC why this is so
----------------------------------------
>>> # the termination mailbox unit number is a 16-bit value
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, None, 'CREPRC_TST',3,
... None, 65536, None)
Traceback (innermost last):
File "<stdin>", line 1, in ?
TypeError: argument 10: mbxunt - must be a 16-bit integer or None
>>>
----------------------------------------
>>> # the system service reports invalid status flags
>>> l_stsflg = -1
>>> l_pid = vms_sys.creprc('SYS$SYSTEM:LOGINOUT.EXE',None,
... None, None, None, None, 'CREPRC_TST',3,
... None, None, l_stsflg)
Traceback (innermost last):
File "<stdin>", line 1, in ?
vms_sys.error: (380, '%SYSTEM-F-IVSTSFLG, invalid status flag')
>>>
@@ more examples for CREPRC
(go to: table of contents,
index,
list of vms_sys,
prev: CRELNT,
next: DACEFC)