Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

how to deploy a lisp image with swank, and run as a daemon

As seid in the title, I want to deploy a Lisp image which is runnable with Swank. This can be done by using the image dump function provided by lisp implementations. But how can it run as a daemon?

Detachtty does a good job, but when I deploy, detachtty is required by the user; I don't like this solution, I just want a standalone one.

Restas-daemon and sb-daemon may be another choice, but both are SBCL-related. Is there a portable solution, or one just for Clozure CL?

I tried the daemon library from quicklisp too, but when I started Swank in it, it hung. I could see in the proc file system that the socket file descriptors were destroyed.

Now I have no idea.

Does anyone have something to advise?

like image 529
whitelilis Avatar asked Jul 14 '13 05:07

whitelilis


2 Answers

If you want to daemonize it you can use sb-posix:fork under SBCL to perform double fork (see What is the reason for performing a double fork when creating a daemon?). I believe other implementations have POSIX API as well.

If you just want the lisp process to run while the system is running even after you logout then use GNU screen. It let you detach without terminating your (lisp) process.

like image 149
peroksid Avatar answered Nov 17 '22 19:11

peroksid


You may want to try cl-daemonize. From the description, "A tool to daemonize a Lisp process without the need for screen/detachtty".

like image 42
gsl Avatar answered Nov 17 '22 19:11

gsl