Operating System - OpenVMS
1753347 Members
4995 Online
108792 Solutions
New Discussion юеВ

Re: how to put a process to background

 
SOLVED
Go to solution
edward wang_1
Frequent Advisor

how to put a process to background

Hi
vms,want to run a programe and put to background.
for example
$run a.exe
how to put process was created by a.exe to background.

thanks first
5 REPLIES 5
Joseph Huber_1
Honored Contributor

Re: how to put a process to background

VMS is not Unix :-)

DCL allows one image at a time in the "foreground".
You have to run the program in the "background" from the beginning using the SPAWN command like
SPAWN/NOWAIT run a.exe

And see the ATTACH command to bring a spawned process into the "foreground".
And caveat for terminal interactions of spawned subprocesses: one should not simply spawn a screen-oriented editor this simple way (search for "KEPT EDIT" to see how).

See also the RUN /DETACHED command to run a program completely independent from the current process or login.
Search for DETACHED AND LOGINOUT in this forum.
http://www.mpp.mpg.de/~huber
Jan van den Ende
Honored Contributor
Solution

Re: how to put a process to background

Edward,

firstly, I think you need to put "Unix-style thinking" a nit out of your mind.

$ run x.exe does _NOT_ create its own process, it run in the context of the process issuing it.

If you want it in a separate process, either
$ RUN/DETACH a.exe
( creates something comparable to a deamon process)
or
$ SPAWN some-comfile-which contains $ run a.exe
(creates a child process running the programm)
or
same with /NOWAIT qualifier added
(creates background process much in Unix style, except terminating the issuing process also "kills" the child)
or (preferably)
$ SUBMIT some-com-filewhich contains a.o. the RUN command.
This is more-or-less comparable to CRON job
SUBMIT has its own qualifiers which give a lot of control over the execution.
See $ HELP submit for specifics.

hth

Proost.

Have one on me.

jpe
Don't rust yours pelled jacker to fine doll missed aches.
Robert Gezelter
Honored Contributor

Re: how to put a process to background

Edward,

As Joe and Jan have stated, VMS is not *IX. The concepts behind process management are not the same.

If I had to guess, the most likely solution would be either a batch job (using the SUBMIT command) or a sub-process (using SPAWN/NOWAIT). Both are ordinary user operations requiring no additional privileges.

RUN/DETACH requires the DETACH privilege.

- Bob Gezelter, http://www.rlgsc.com
edward wang_1
Frequent Advisor

Re: how to put a process to background

thank you so much for all reply
Hoff
Honored Contributor

Re: how to put a process to background

Load GNV and the bash shell, and push the command into the background using the usual mechanisms. AFAIK, this works just fine on OpenVMS.