how to make newlisp app run in background

Q&A's, tips, howto's
Locked
csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

how to make newlisp app run in background

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

csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

Re: how to make newlisp app run in background

Post 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 &

csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

Re: how to make newlisp app run in background

Post by csfreebird »

It works.

rickyboy
Posts: 607
Joined: Fri Apr 08, 2005 7:13 pm
Location: Front Royal, Virginia

Re: how to make newlisp app run in background

Post by rickyboy »

Glad it worked out!
(λx. x x) (λx. x x)

jopython
Posts: 123
Joined: Tue Sep 14, 2010 3:08 pm

Re: how to make newlisp app run in background

Post by jopython »

If you are using the bash shell, you can simply run "disown"

tomtoo
Posts: 46
Joined: Wed Oct 28, 2009 10:00 pm

Re: how to make newlisp app run in background

Post by tomtoo »

or use screen and detach the session...

csfreebird
Posts: 107
Joined: Tue Jan 15, 2013 11:54 am
Location: China, Beijing
Contact:

Re: how to make newlisp app run in background

Post by csfreebird »

disown, thanks, I got another way.

Locked