Re: background/SIGTERM



Please see below.

--

"Wolf Grossi" <ng-wg@xxxxxxxxxxxxxx> schreef in bericht
news:42f24b39$0$3855$79720d31@xxxxxxxxxxxxxxxxxxxxxx
> Hi all,
>
> back again :-) and a bunch'o questions popup on my UNIX-C-app porting:
>
> 1) what is the proper way start a TCP-server?
> Currently I do a CALL MYLIB/MYSERVER but this blocks the session.
> Can I start the server in background-mode, as I'd say on *nix?

Sure can. It's called submitting and basically you do a SBMJOB MYSERVER
CMD(CALL MYLIB/MYSERVER) JOBQ(QSYSNOMAX)

The use of QSYSNOMAX may be debatable for purists, but for now it's sure
to do the trick. You may tune things later when you get more familiar
with the concept.

>
> Am I right assuming that on OS400 a daemon is something to be afraid
> of :-) and not a standalone-process?

Essentially a batch job is a standalone process, but that's a matter of
definition. It does require an active subsystem to run in, but it's not
dependent on other jobs..

>
> 2) To terminate the server I curently use WRKACTJOB and then terminate
> with ENDJOB. But this does not seem to be the right approach as the
> interactive session I've started the server terminates...

That's because you a never ending command in your interactive session;
you kill the job, you kill the session.
Interactively you can hit Sytem Request and take option 2, issuing an
ENDRQS to your running command. That'll kill the server, not your job.
In the batch situation, obviously killing the job just kills the server.

>
> I have searched the various docs at IBM iSeries Information Center,
but
> apparently I'm using the wrong wording :-)).
> 'kill' brings a good description but refers to the qsh...

OS/400 terminology is ENDJOB, but effectively it kills it. You can make
your server sense on controlled endjob requests and end gracefully, or
you may send it an endrequest through a message queue or dataqueue. But
that's probably for later...

>
> Thanks for reading and remarks,
> Wolf

You're welcome


.



Relevant Pages

  • Re: background/SIGTERM
    ... > Can I start the server in background-mode, ... use the STRTCPSVR command. ... > 2) To terminate the server I curently use WRKACTJOB and then terminate ... > interactive session I've started the server terminates... ...
    (comp.sys.ibm.as400.misc)
  • Re: Detect End Process in application
    ... viruses that when you kill the process it starts right back up. ... So my previous answer "No it can't be done" might be wrong, all depends on why the user decides to use 'Taskman' to terminate an application, let me explain. ... The latter cannot be trapped, simply because no more user code will run in that process, the user portion of a process is cleaned up without returning a thread quantum to the process,. ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: named startup problems upgrading from 7.1p4 to 7.1p5 or 7.1p6
    ... Sorry for starting a new thread with this - my ISP's mail server seems to rejecting all mail recipients when I ... file being created) or by a kill command other than kill -9. ... local devdir rs _me ... Running any rndc command causes rndc to load ...
    (freebsd-questions)
  • Re: C# Threading, and suspending or killing a thread
    ... Other threads that are spawned like this go right back to zero CPU, ... the Process Explorer to kill it there. ... When you terminate a thread in a .NET application you should consider the whole appdomain doomed, as in, you should no longer keep it around. ... - deadlocks, if the thread locks internal resources it will never unlock them, thus blocking future threads from ever accessing the resources the lock protects ...
    (microsoft.public.dotnet.languages.csharp)
  • Re: Allow non-Administrator to view and terminate processes for all users
    ... that is a classic client server implementation. ... tight CPU loop - no page faults, no I/O, no database interaction, no network ... track down and terminate the "bad" processes. ...
    (microsoft.public.windows.server.security)