I plan to have several node apps running on different ports, and would
like to automate this. Currently I just have a screen session for each
running in the background.
I'm willing to work on the script myself, but I'm just wondering if
anyone would like to help and/or give suggestions.
Here is my desired feature list.
* the start command reads through a config file and/or config directory
that contains site configs
* Each config will have the script to run and the port to run it on
* config will have a path to log the output of the script
* also I would like to have a flag to enable auto restart, possibly
using run.js or via simple bash scripting. This isn't as important
though, just handy
* stop would terminate all the node instances
* restart would simply stop and start everything
Basically I want a way to define all my apps in static configs and then
have the services autostart on reboot.
Also, I seem to remember reading somewhere in the docs that we currently
don't support unix named sockets. I would much prefer this since my
apps won't be directly accessible to the public, but only to the nginx
reverse proxy. Nginx supports named sockets, and I would like the added
performance and security for my node apps.
I'm running Ubuntu 9.04 BTW, I know other distros have slightly
different init.d script setups.
--Tim Caswell
This is totally off topic: I've written an NGINX module for which
implements a haproxy-like load balancing:
http://github.com/ry/nginx-ey-balancer/tree/master
> Since github seems to be down at the moment, I put temporary symlinks to
> the js files that you can access here:
Maybe we should move to node.js ;)
--
Chris Wanstrath
http://github.com/defunkt
Joshaven Potter wrote:
> case "$1" in
> start)
> $DAEMON start --all $CONFIG_PATH
> ;;
> stop)
> $DAEMON stop --all $CONFIG_PATH
> ;;
> restart)
> $DAEMON restart --all $CONFIG_PATH
> ;;
> *)
> echo "Usage: $SCRIPT_NAME {start|stop|restart}" >&2
> exit 3
> ;;
> esac
>
> :
>
> one of my thin configs from /etc/thin looks like: ( cat
> /etc/thin/joshaven.com <http://joshaven.com> ):
> ---
> user: www-data
> group: www-data
> pid: /tmp/pids/thin.pid
> address: 127.0.0.1
> timeout: 30
> port: 8001
> log: log/thin.log
> max_conns: 1024
> require: []
>
> environment: production
> max_persistent_conns: 512
> servers: 2
> chdir: /home/joshaven/apps/joshaven.com/ <http://joshaven.com/>
>
>