running os-command no-wait on an appserver

KrisM

Member
When I run an os-command no-wait on an appserver process, the appserver process spawns a new process and continues it' s work. When that work is finished, the appserver becomes available to accept new tasks.
So far so good.
However, when I try to stop this appserver (which has no active connections any more), the appserver refuses to stop until the spawned process itself has stopped.
Adding nohup in front of the command does not help. :(


Anybody has an idea how to solve this ?
 
When I run an os-command no-wait on an appserver process, the appserver process spawns a new process and continues it' s work. When that work is finished, the appserver becomes available to accept new tasks.
So far so good.
However, when I try to stop this appserver (which has no active connections any more), the appserver refuses to stop until the spawned process itself has stopped.
Adding nohup in front of the command does not help. :(


Anybody has an idea how to solve this ?

nohup indicates you are on unix.

NO-WAIT is Windows only.

Try SILENT (any output should be directed to file), but I don't know if that will work.
 
not a unix guy myself

but i think that on unix you can run scripts in the background by adding an ampersand (&) at the end of the command line.

heres the first thing i googled

My tinyurl above isn't working, but it says similar to Joey.

KB P59724 said:
The workaround is to use the SILENT and & sign in the end of the value part of the OS-COMMAND statement to avoid hitting the NO-WAIT issue.
 

KrisM

Member
Strange that no-wait is supposed to be windows only.
It works just fine for me on unix (although adding ampersand works just as well).
Problem is not the no-wait though, it is an appserver that seems to be doing nothing at all, but still cannot be stopped.
 
Problem is not the no-wait though, it is an appserver that seems to be doing nothing at all, but still cannot be stopped.

Some avenues to investigate, in case you haven't tried them already...

Is the appserver hanging definitely the one launching the script? For instance if a child 4GL process of the script attaches itself to another appserver it may be that process that it hanging.

Is the code that launches the script exiting properly? ie. Are you using STOP or QUIT (You may need to use QUIT, or the process may not exit completely)?

Is the client that issues the batch start request disconnecting and deleting the appserver context correctly?

Have you tried a skeleton test case with a simple (eg. one line 'echo') script to ensure that the issue is being caused by the Appserver call to the batch script and not a child of the script itself?

Finally, you can stop the process manually with absman kill, but I guess that's not what you're after.
 
When I run an os-command no-wait on an appserver process, the appserver process spawns a new process and continues it' s work. When that work is finished, the appserver becomes available to accept new tasks.
So far so good.
However, when I try to stop this appserver (which has no active connections any more), the appserver refuses to stop until the spawned process itself has stopped

Sorry, my bad, the above highlighted rules out most of my suggestions above, as you clearly state the appserver is not hanging/connected.

But hopefully you did try removing the NO-WAIT and trying SILENT with & instead perhaps with a skeleton script?
 

KrisM

Member
This is the skeleton script that I run :
  • echo 'start'
  • wait a few minutes
  • echo 'end'
I have a simple .p that runs this script (with no-wait , silent, ampersand, nohup, ... whatever).

I run this .p over an appserver.

Result is that the .p runs the script and ends immediately.
Client disconnects from the appserver immediately.
I try to stop the appserver.
The appserver does not stop until the script ends.
 
Sorry Kris,

My meagre unix knowledge is also exhausted. I'm also rather perplexed by the implication from your first post that you can continue on, and even reconnect to the agent after spawning the process, but can't stop it.

Apart from turning the verbose Appserver logging on to see if you can monitor what exactly is going on, all I can suggest is that you try the Peg (www.peg.com) or Progress Tech support.
 
Top