Arc Forumnew | comments | leaders | submitlogin
2 points by thaddeus 5455 days ago | link | parent

> I would like to run hacker news in batch mode ?

Why would you want to do that? If it's just so the terminal window isn't up, I would suggest using screen -> http://www.gnu.org/software/screen, or if using a mac you could run an apple script which would run the process silently:

     do shell script "cd /Users/thaddeus/arc;
     /Users/thaddeus/scheme422/bin/mzscheme -f loadscript.scm"
> how to run it alongside apache, or listening on a particular ip address?,

I think this is more an apache discussion point so I would suggest google searching 'mod proxy'. There's are tonnes of write ups on this kind of stuff and Linode.com has in-depth how to's. Mod Proxy just redirects incoming requests from an IP/domain to a specific port. As for Arc see the function (asv) which you can change the port number and just run it - I think it's in srv.arc.



1 point by user2 5454 days ago | link

Let me describe a bit more:

Here's what I normally do as per how-to-run-news.txt

mzscheme -f as.scm

I get the mzscheme prompt. I type:

(load "news.arc") (nsv)

It runs well, so far so good, but I have the interactive interpreter. As soon as I shut down, the service disappears.

To run it as a shell script I looked at mzcheme man page and tried to run the following in a script called run_hacker_news.sh:

[script starts] #! /bin/sh #|

exec /home/bahadir/mz/bin/mzscheme -f as.scm |# (load "news.arc") (nsv) [script ends]

This doesn't work. I just want to run it and logout so it stays running. It's a linux box. Thanks a lot.

-----

1 point by thaddeus 5454 days ago | link

> It runs well, so far so good, but I have the interactive interpreter. As soon as I shut down, the service disappears.

This is where 'screen' comes in handy. Screen is a threaded model: it assigns a single thread for each 'screen' used. It also has a built in command to detach from your screen session (CNTRL+a d). After detaching you can then close the terminal window and arc will still be running as a silent thread. To get back just launch screen with the option to re-attach ($ screen -x).

-----

1 point by user2 5454 days ago | link

The parts with parenthesis () are multi-line, the post is displayed as single line somehow.

-----

1 point by thaddeus 5454 days ago | link

You need an extra line break to separate lines.

  Or indent a line by at least two spaces to get text verbatim.

-----