Page 1 of 1

how to make newlisp app run in background

Posted: Tue Nov 26, 2013 11:20 pm
by csfreebird
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:

Code: Select all

./test.lsp 192.168.1.57 7777 131031000043 131031000143 &
in test.lsp, I launch 100 processes like this:

Code: Select all

;; 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 ".")))

Re: how to make newlisp app run in background

Posted: Wed Nov 27, 2013 1:11 am
by csfreebird
maybe nohup command can do this. I am trying:

Code: Select all

nohup ./test.lsp 192.168.1.57 7777 131031000043 131031000143 > /dev/null 2>&1 &

Re: how to make newlisp app run in background

Posted: Wed Nov 27, 2013 4:47 am
by csfreebird
It works.

Re: how to make newlisp app run in background

Posted: Wed Nov 27, 2013 2:49 pm
by rickyboy
Glad it worked out!

Re: how to make newlisp app run in background

Posted: Thu Nov 28, 2013 2:34 am
by jopython
If you are using the bash shell, you can simply run "disown"

Re: how to make newlisp app run in background

Posted: Thu Nov 28, 2013 3:29 pm
by tomtoo
or use screen and detach the session...

Re: how to make newlisp app run in background

Posted: Fri Nov 29, 2013 1:27 pm
by csfreebird
disown, thanks, I got another way.