This is incorrect, screen allows you to partition a console but will not
guarantee your service is automatically started at boot time or restarted
if it fail.

As Ryan said, it depends what OS are you targeting. The way you do services
in ubuntu is with upstart. You put an script under /etc/init/your-app.conf :


description "your-app"

author  "you"

setuid some-user

start on (local-filesystems and net-device-up IFACE=eth0)

stop on shutdown

respawn

respawn limit 15 5

script

  exec >>/var/log/$UPSTART_JOB.log 2>&1

  echo starting\ $UPSTART_JOB\ `date`

  cd /usr/local/lib/node_modules/your-app

  NODE_ENV=production CONFIG_FILE="/etc/your-app.json" npm start

end script

You can store your application in any path, usually /opt, the one i used
for this example assumes you install your-app as a global node module.

This will redirect stdout and stderr to /var/log/your-app.log, make sure
you create a logrotate rule.

It also assumes you have some sort of config file in /etc/your-app.json.

Then the service will be started when booting the OS, and restarted if it
fails.

You can also start/stop/restart manually as follows:

service your-app stop/start/restart

If you symlink /etc/init/your-app.conf to /etc/init.d/your-app, you will
get also tab-completion in bash when writing service yo.

Every SO has a different way of doing this :

   -

   initng
    -

   launchd
    -

   upstart
    -

   Service Management Facility
    -

   systemd
    -

   OpenRC
    -

   runit
    -

   daemontools

to name a few.


regards






El ago 25, 2013 10:41 a.m., "Ashutosh Das" <[email protected]> escribió:

> You can use screen . Here is a tutorial :
> how-to-install-and-use-screen-on-an-ubuntu-cloud-server<https://www.digitalocean.com/community/articles/how-to-install-and-use-screen-on-an-ubuntu-cloud-server>
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
>

-- 
-- 
Job Board: http://jobs.nodejs.org/
Posting guidelines: 
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en

--- 
You received this message because you are subscribed to the Google Groups 
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to