Path: utzoo!attcan!uunet!lll-winken!lll-tis!helios.ee.lbl.gov!pasteur!ucbvax!VENUS.YCC.YALE.EDU!LEICHTER From: LEICHTER@VENUS.YCC.YALE.EDU ("Jerry Leichter ", LEICHTER-JERRY@CS.YALE.EDU) Newsgroups: comp.os.vms Subject: re: Subprocess creation problem Message-ID: <8805260732.AA18842@ucbvax.Berkeley.EDU> Date: 24 May 88 15:26:00 GMT Sender: daemon@ucbvax.BERKELEY.EDU Organization: The Internet Lines: 56 I have been having a problem with a program creating a process using CREPRC. If the output of the executable has been redirected in ANY way it doesn't create the subprocess and execute the commands in the datafile.... For example, The program works fine when I use the following DCL commands: $RUN DETACH_PROG $TYPE SYS$LOGIN:DETACH_PROG.LOG [....log file is here with information...] HOWEVER, If I use the /INPUT, /OUTPUT or /DETACH qualifier the program doesn't create the log file and doesn`t execute the commands in DETACH_PROG.DAT. It seems ANY redirection of I/O to the program will cause the subprocess not to be created. For example, $RUN DETACH_PROG /OUTPUT=SYS$LOGIN:ANYTHING.HERE $TYPE SYS$LOGIN:DETACH_PROG.LOG or $RUN DETACH_PROG /DETACH $TYPE SYS$LOGIN:DETACH_PROG.LOG [produce no output.] Using any of /INPUT, /OUTPUT, or /DETACH produces a detached process, one that is not part of your job tree; so all the examples you've had problems with end up looking pretty much the same. They are, in fact, all running into the same "gotcha'": The file spec you provide for /INPUT or /OUTPUT is passed, COMPLETELY UNINTERPRETED, to the created process. The created process will then try to open the file. It must be able to do so, IN ITS OWN CONTEXT; that is, any logicals used in the file specs must be defined in that context. When you create a detached process, it starts out with its own job table, so it can't inherit the job-wide definition of SYS$LOGIN that the creating process has. Well, where did that definition come from? LOGINOUT put it there when the process logged in. A process created with $CREPRC (or RUN/DET) does NOT run LOGINOUT (although you can have it do so explicitly). Hence, it has no definition for SYS$LOGIN, so its attempt to open its output file fails. Boom. How could you have found this out yourself? When a process dies, unless it has disabled accounting (not the case here), its final exit status is written to the accounting file. If you had used the ACCOUNTING command to check the accounting record for your processes, you would probably have found that the final exit status was "failed to open output file", or some such. Not a huge amount of information - without knowing about the problem with logicals, probably not enough to let you figure out what is going on - but sometimes enough to get you started. -- Jerry