0

If I make some server side programs with node.js / Java / Python what is the best way to run them and make them run every time I boot my server. Is crontab @reboot valid way to do this. If so how do I start and stop those so I can modify code without having to reboot server?

1 Answer 1

0

Whatever method you prefer but it sometimes depends on what that software you made is used for.

Though I would not use crontab (ie. crontab -e) but /etc/crontab if you want to go that way. You can specify a user in that file but it can also be used normally (ie. edits to /etc/crontab are in effect immediately) and you can also use things like @reboot. It is a very common method to use so if you like that go for it.

You could also create a service (with options start, stop, restart as apache or mysql have). Using forever is an option. Another example upstart script with node.js.

2
  • Hey, thanks I did go with upstart script and that seems to work the way I wanted. At least it worked with node.js probably I can manage it to get work with Java and Python too.
    – Viped
    Commented Jun 4, 2014 at 7:04
  • Yes it will be possible with java and python too. The "forever" scripts are nice to work with too :)
    – Rinzwind
    Commented Jun 4, 2014 at 7:36

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .