Arc Forumnew | comments | leaders | submitlogin
Ask: How to run arc web app in the background?
1 point by feilaoda 4791 days ago | 6 comments
I download the web app from http://ycombinator.com/arc/arc3.1.tar, and deploy it.

ssh to my host, then :

mzscheme -f as.scm

(load "news.arc")

(thread (nsv))

But when i exit from ssh, the server "nsv" is down. so i can't back to the prompt.

I try this: "mzscheme -m -f as.scm < news.arc &", but i got errors like "Error: "Bad object in expression #<eof>"

How shoud i do?



3 points by thaddeus 4791 days ago | link

Use Screen. It will keep the session going after you close off the window and allow you to re-attach when you want to get back.

http://www.gnu.org/software/screen/

If you're on ubuntu:

  sudo apt-get install screen
if you want the extra's

  sudo apt-get install screen screen-profiles screen-profiles-extras

-----

1 point by lark 4789 days ago | link

A related question: how can I connect to the repl and upgrade the app without killing the process?

-----

2 points by akkartik 4789 days ago | link

In general there's no way to do this, but you can simulate hot-swapping with thread and a little code organization. In readwarp.com, for example, I arrange the code so loading a file multiple times doesn't break behavior. Among other things it requires not reinitializing global variables, only functions. See http://arclanguage.org/item?id=11103, expecially tips 1 and 2.

-----

1 point by lark 4787 days ago | link

How would one hot-swap continuations?

-----

1 point by akkartik 4787 days ago | link

You mean like fnids? They're just data, so you should be able to reuse them as is. If you change the html for the frontpage old continuations to the next page may not reflect the change, but they'll gradually expire and get replaced with the updated versions.

-----

1 point by feilaoda 4789 days ago | link

for all:

> sudo apt-get install screenie

> screenie

screenie is perfect.

Thanks for all!

-----