Mailing List Archive

node.js?
Hi there,

I have a software that requires nodejs and I start it by "node api/server.js".

Can I somehow start that server.js with cherokee, instead of nodejs. Or have nodejs run by cherokee, or similar?

The reason is that I want to have it running on boot and if theres a nice possibility with what I already have, that'd be great.

Thanks

Stadtpirat
Re: node.js? [ In reply to ]
It might be better to not have Cherokee tied to your node app. Instead,
start it up on boot by itself and keep it running separately.

Google around and I'm sure you can find ways to have your node app run on
boot.

A quick search revealed the possibility of adding it to /etc/rc.local or
this http://kvz.io/blog/2009/12/15/run-nodejs-as-a-service-on-ubuntu-karmic/

To keep your node app running, use something like "forever"
https://github.com/nodejitsu/forever

-Locke

On Thu, Jan 24, 2013 at 5:38 AM, - - <stadtpirat11@ymail.com> wrote:

> Hi there,
>
> I have a software that requires nodejs and I start it by "node
> api/server.js".
>
> Can I somehow start that server.js with cherokee, instead of nodejs. Or
> have nodejs run by cherokee, or similar?
>
> The reason is that I want to have it running on boot and if theres a nice
> possibility with what I already have, that'd be great.
>
> Thanks
>
> Stadtpirat
>
>
> _______________________________________________
> Cherokee mailing list
> Cherokee@lists.octality.com
> http://lists.octality.com/listinfo/cherokee
>
>
Re: node.js? [ In reply to ]
On 24 January 2013 20:38, - - <stadtpirat11@ymail.com> wrote:

> Hi there,
>
> I have a software that requires nodejs and I start it by "node
> api/server.js".
>
> Can I somehow start that server.js with cherokee, instead of nodejs. Or
> have nodejs run by cherokee, or similar?
>
> The reason is that I want to have it running on boot and if theres a nice
> possibility with what I already have, that'd be great.
>

It is possible to have Cherokee start your service for you (add the command
to run it as a Local Interpreter under Information Sources in your
Cherokee-admin control panel), but a word of warning is that if you need to
restart your Cherokee instance, it will restart your service as well.
Also, there isn't presently the ability to control or restart the local
interpreter from Cherokee.

This might fit your use-case, but I found it far more robust to use
something like Supervisor (http://supervisord.org/) which gives a lot more
control over your processes. Using something like this (or init.d or rc.d
etc) means the service(s) can start on boot, rather than 'on first access'
which is what happens if started as part of Cherokee.

-- David