comp.lang.idl-pvwave archive - RDF feed
type: channel
description: Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado
items: SPAWN background command without nohup?
items: Re: SPAWN background command without nohup?

SPAWN background command without nohup?
type: item
description: Dear Folks, Using SPAWN to start a background process on unix-like systems can leave the process running even after the IDL process terminates. I'd like to arrange things so that the child process is killed when IDL exits. Here's a schematic example: IDL> spawn, 'myprocess &', pid=pid IDL> print, pid 62417 IDL> exit $ ps | grep 62417 grier 62417 0.0 0.1 2473856 12320 ?? S 10:41AM 0:00.02 myprocess This is similar to running a shell command with nohup: $ nohup myprocess & $ exit Is there a way to make IDL spawn a child process that terminates when the parent IDL session terminates? All the best, David
creator: dg86
date: 2014-06-28T15:27:48-00:00

Re: SPAWN background command without nohup?
type: item
description: On Saturday, June 28, 2014 5:27:48 PM UTC+2, David Grier wrote: > Dear Folks, > > > > Using SPAWN to start a background process on unix-like systems > > can leave the process running even after the IDL process terminates. > > I'd like to arrange things so that the child process is killed when IDL exits. > > > > Here's a schematic example: > > > > IDL> spawn, 'myprocess &', pid=pid > > IDL> print, pid > > 62417 > > IDL> exit > > > > $ ps | grep 62417 > > grier 62417 0.0 0.1 2473856 12320 ?? S 10:41AM 0:00.02 myprocess > > > > This is similar to running a shell command with nohup: > > $ nohup myprocess & > > $ exit > > > > Is there a way to make IDL spawn a child process that terminates when > > the parent IDL session terminates? > > > > All the best, > > > > David You might try to keep your spawned process synchronized with the parent IDL session : maybe by using the UNIT keyword ? Just a guess, I have no experience with unix. alx.
creator: lecacheux.alain
date: 2014-06-30T09:34:13-00:00

Re: SPAWN background command without nohup?
type: item
description: On Monday, June 30, 2014 5:34:13 AM UTC-4, alx wrote: > On Saturday, June 28, 2014 5:27:48 PM UTC+2, David Grier wrote: > >> Dear Folks, > >> > >> > >> > >> Using SPAWN to start a background process on unix-like systems > >> > >> can leave the process running even after the IDL process terminates. > >> > >> I'd like to arrange things so that the child process is killed when IDL exits. > >> > >> > >> > >> Here's a schematic example: > >> > >> > >> > >> IDL> spawn, 'myprocess &', pid=pid > >> > >> IDL> print, pid > >> > >> 62417 > >> > >> IDL> exit > >> > >> > >> > >> $ ps | grep 62417 > >> > >> grier 62417 0.0 0.1 2473856 12320 ?? S 10:41AM 0:00.02 myprocess > >> > >> > >> > >> This is similar to running a shell command with nohup: > >> > >> $ nohup myprocess & > >> > >> $ exit > >> > >> > >> > >> Is there a way to make IDL spawn a child process that terminates when > >> > >> the parent IDL session terminates? > >> > >> > >> > >> All the best, > >> > >> > >> > >> David > > > > You might try to keep your spawned process synchronized with the parent IDL session : maybe by using the UNIT keyword ? > > Just a guess, I have no experience with unix. > > alx. Thanks for thinking about this. Using the UNIT keyword is indeed useful for shutting down the child process from the parent IDL session. It doesn't help, however, if the user exits IDL without actively shutting down the child process. I'm looking for a way to spawn a child process that runs in the background and cleanly quits when the parent IDL session ends. All the best, David
creator: dg86
date: 2014-06-30T10:03:04-00:00

Re: SPAWN background command without nohup?
type: item
description: On Monday, June 30, 2014 12:03:04 PM UTC+2, David Grier wrote: > On Monday, June 30, 2014 5:34:13 AM UTC-4, alx wrote: > >> On Saturday, June 28, 2014 5:27:48 PM UTC+2, David Grier wrote: > >> > >>> Dear Folks, > >> > >>> > >> > >>> > >> > >>> > >> > >>> Using SPAWN to start a background process on unix-like systems > >> > >>> > >> > >>> can leave the process running even after the IDL process terminates. > >> > >>> > >> > >>> I'd like to arrange things so that the child process is killed when IDL exits. > >> > >>> > >> > >>> > >> > >>> > >> > >>> Here's a schematic example: > >> > >>> > >> > >>> > >> > >>> > >> > >>> IDL> spawn, 'myprocess &', pid=pid > >> > >>> > >> > >>> IDL> print, pid > >> > >>> > >> > >>> 62417 > >> > >>> > >> > >>> IDL> exit > >> > >>> > >> > >>> > >> > >>> > >> > >>> $ ps | grep 62417 > >> > >>> > >> > >>> grier 62417 0.0 0.1 2473856 12320 ?? S 10:41AM 0:00.02 myprocess > >> > >>> > >> > >>> > >> > >>> > >> > >>> This is similar to running a shell command with nohup: > >> > >>> > >> > >>> $ nohup myprocess & > >> > >>> > >> > >>> $ exit > >> > >>> > >> > >>> > >> > >>> > >> > >>> Is there a way to make IDL spawn a child process that terminates when > >> > >>> > >> > >>> the parent IDL session terminates? > >> > >>> > >> > >>> > >> > >>> > >> > >>> All the best, > >> > >>> > >> > >>> > >> > >>> > >> > >>> David > >> > >> > >> > >> You might try to keep your spawned process synchronized with the parent IDL session : maybe by using the UNIT keyword ? > >> > >> Just a guess, I have no experience with unix. > >> > >> alx. > > > > Thanks for thinking about this. > > > > Using the UNIT keyword is indeed useful for shutting down the child process from the parent IDL session. It doesn't help, however, if the user exits IDL without actively shutting down the > > child process. > > > > I'm looking for a way to spawn a child process that runs in the background and cleanly quits when > > the parent IDL session ends. > > > > All the best, > > > > David > …
creator: lecacheux.alain
date: 2014-06-30T11:17:02-00:00

Re: SPAWN background command without nohup?
type: item
description: On Monday, June 30, 2014 7:17:02 AM UTC-4, alx wrote: > On Monday, June 30, 2014 12:03:04 PM UTC+2, David Grier wrote: > >> On Monday, June 30, 2014 5:34:13 AM UTC-4, alx wrote: > >> > >>> On Saturday, June 28, 2014 5:27:48 PM UTC+2, David Grier wrote: > >> > >>> > >> > >>>> Dear Folks, > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> Using SPAWN to start a background process on unix-like systems > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> can leave the process running even after the IDL process terminates. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> I'd like to arrange things so that the child process is killed when IDL exits. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> Here's a schematic example: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> IDL> spawn, 'myprocess &', pid=pid > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> IDL> print, pid > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> 62417 > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> IDL> exit > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> $ ps | grep 62417 > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> grier 62417 0.0 0.1 2473856 12320 ?? S 10:41AM 0:00.02 myprocess > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> This is similar to running a shell command with nohup: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> $ nohup myprocess & > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> $ exit > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> Is there a way to make IDL spawn a child process that terminates when > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> the parent IDL session terminates? > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> All the best, > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > >> > >>> > >> > …
creator: dg86
date: 2014-06-30T12:06:48-00:00

Re: SPAWN background command without nohup?
type: item
description: If you use SETENV to create an environment variable, it would at least give you access to the PIDs after IDL exits. If you could then monitor IDL to know when it exits, you could kill any remaining processes.
creator: Matthew Argall
date: 2014-06-30T12:40:58-00:00

Re: SPAWN background command without nohup?
type: item
description: On Monday, June 30, 2014 2:06:48 PM UTC+2, David Grier wrote: > On Monday, June 30, 2014 7:17:02 AM UTC-4, alx wrote: > >> On Monday, June 30, 2014 12:03:04 PM UTC+2, David Grier wrote: > >> > >>> On Monday, June 30, 2014 5:34:13 AM UTC-4, alx wrote: > >> > >>> > >> > >>>> On Saturday, June 28, 2014 5:27:48 PM UTC+2, David Grier wrote: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > Dear Folks, > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > Using SPAWN to start a background process on unix-like systems > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > can leave the process running even after the IDL process terminates. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > I'd like to arrange things so that the child process is killed when IDL exits. > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > Here's a schematic example: > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > IDL> spawn, 'myprocess &', pid=pid > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > IDL> print, pid > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > 62417 > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > IDL> exit > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > > >> > >>> > >> > >>>> > >> > >>> > >> > >>>> > $ ps | grep 62417 > >> > >>> > >> > >>>> > >> > …
creator: lecacheux.alain
date: 2014-06-30T16:21:41-00:00