newLISP Fan Club

Forum => newLISP in the real world => Topic started by: csfreebird on November 26, 2013, 03:20:44 PM

Title: how to make newlisp app run in background
Post by: csfreebird on November 26, 2013, 03:20:44 PM
Hi, I ssh remote server, run my newlisp app in terminal with operator &, then I close my terminal window.

but after about 2 hours, all newlisp processes are terminated. Why? I run below command in terminal:

./test.lsp 192.168.1.57 7777 131031000043 131031000143 &


in test.lsp, I launch 100 processes like this:

;; create and run signs one by one                                                                                                            
(let ((a (int sign-from 0 10)) (b (int sign-to 0 10)))
  (println a)
  (println b)
  (until (= a b)
         (begin
          (spawn 'm (create-sign server (int port) (int-to-address a)))
          (++ a)
          (println "a:" a)
          ))
  (until (sync 2000) (print ".")))
Title: Re: how to make newlisp app run in background
Post by: csfreebird on November 26, 2013, 05:11:03 PM
maybe nohup command can do this. I am trying:

nohup ./test.lsp 192.168.1.57 7777 131031000043 131031000143 > /dev/null 2>&1 &
Title: Re: how to make newlisp app run in background
Post by: csfreebird on November 26, 2013, 08:47:03 PM
It works.
Title: Re: how to make newlisp app run in background
Post by: rickyboy on November 27, 2013, 06:49:42 AM
Glad it worked out!
Title: Re: how to make newlisp app run in background
Post by: jopython on November 27, 2013, 06:34:02 PM
If you are using the bash shell, you can simply run "disown"
Title: Re: how to make newlisp app run in background
Post by: tomtoo on November 28, 2013, 07:29:44 AM
or use screen and detach the session...
Title: Re: how to make newlisp app run in background
Post by: csfreebird on November 29, 2013, 05:27:43 AM
disown, thanks, I got another way.