On 12/4/2015 11:47 AM, Héctor Mc wrote:
... the project is in https://github.com/hmcab/anauj.git , and the server run 
from generacion-datos/codegen.rkt on the bottom the file. Read the readme file 
before the execution.

At this time I have the application on amazon server to prove it, but every time
that I leave the ssh connection, and so, the application is executed with
racket -t codegen.rkt &, this falls (no any access from the browser is 
achieved), but if I enter to the amazon server with ssh again, the process is still 
there.



Ordinarily, a background process keeps running when its controlling terminal is closed. However, if the process ever writes anything to the terminal (stdout or stderr) and the write is not redirected into a file, the write will stall the process (or at least the thread that did the write).

The other problem is that when you log out, the process becomes an orphan and ownership of it is transferred to the root init process or to a root daemon process (system dependent). The server may be configured to terminate orphaned user processes. Terminated processes may be visible in the process listing for a time - at this point they are called "zombies" - but they aren't running. Zombie processes eventually disappear, but the clean up period is configurable.

There is a command called "daemon" on some systems that will detach a user process from the starting terminal and allow it to keep running after log off. However, the command may not be available if they don't want you to use it. And if you are permitted to create daemon processes, understand that they will terminate when/if the server shuts down and will not be started again when the server reboots.


If you need your program to run whenever the server is running, you need root access to configure it as a service and to administer it later. You need to create an init.d script in /etc/init.d and configure the system to use it. The major distros now all implement the Sys-V system for administering services, so the procedure is similar on every system.

Look in /etc/init.d for a simple script you can understand and modify. There may be an example script (sometimes called "skeleton") in the directory. Copy and rename the script and edit it for your program. Minimally you need to implement "start", "stop" and "status" commands - the others are for interactive use.

Then you need to arrange for the script to be used. On most systems this is done with "chkconfig". On Ubuntu the command is "update-rc.d".

On the init.d script is installed and the system is configured to use it, you can administer your service using "//service <script_name> { start | stop | status }/*"*/

See service(8), chkconfig(8) and daemon(8) in the man pages. Also read about how to configure services for your particular distro.


Hope this helps,
George/
/

--
You received this message because you are subscribed to the Google Groups "Racket 
Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to racket-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to