I am trying to setup PhantomJS to run as a service. I found the skeleton file in /etc/init.d and I am running on Ubuntu 12.10. In trying to figure this out I found the symlinks in the /etc/rc*.d directories and found that Apache runs at run levels 2 through 5.
My question is do I just created a symlink called S02phantomjs in the 2 through 5 folders and point it to the script I put in /etc/init.d? Or should I use some application to configure this?
My concern is that I am missing something. And that the order in the number portion of that has a significant importance that I don't want to mess with.
Also I am not sure if there is anything else I have to do to not only make sure this runs on every boot. But get it to start running now.
One last question. My script, based on skeleton, when I run it in terminal it just sits and waits like when I run PhantomJS normally. I would like to get it to just run in the background like Apache does. What do I have to do differently to accomplish this?