Nohup SBCL ubuntu cannot read from standard input

On Ubuntu, I compiled sbcl 1.0.35 with threads. I can happily use sbcl from the command line, and my hunchentoot site works with threads, but when I log out, it disappears. When I try nohup sbcl

nohup./src/runtime/sbcl --core output / sbcl.core

I get

(SB-IMPL :: SIMPLE-STREAM-PERROR "cannot be read from ~ S" # 9)

I tried various combinations of redirecting standard input to / dev / null or a file and using the script command line option, but I did not quite understand what was going on.

How can I run sbcl from the command line on linux with nohup and save my replica (website)?

+4
source share
3 answers

Dmity-vk sent me on the right path, thanks. SBCL tries to start the replica when it starts and reads from standard input. When you use nohup , the in standard is redirected and cannot be read. Then the SBCL goes to the debugger, which tries to read from the standard into ... hence an infinite loop. The --script tag --script close to a solution, except that it has (quit) after reading the script. So I put an infinite loop in the script and voila.

so on an ubuntu server with sbcl this should allow you to start the hunchentoot server

 sudo nohup ./run-sbcl.sh --script foo.lisp > /dev/null 2> /dev/null & 

where foo.lisp has as its last lines something like

 (defvar *alive* t) (loop (sleep 1000) (if (not *alive*) (quit))) 
+1
source

Andrei Moskvitin’s RESTAS Web Site (“REST Application Server”) contains code to properly demonstrate the SBCL instance. See http://github.com/archimag/restas/blob/master/contrib/restas-daemon.lisp . You can easily break parts related to RESTAS.

+3
source

You can run SBCL in the Gnu Screen and then disconnect from the session.

It also gives you the option to reconnect to your REPL.

+2
source

Source: https://habr.com/ru/post/1304318/


All Articles