Share your knowledge at the LQ Wiki.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 09-05-2012, 04:02 PM   #1
LQ Newbie
Registered: Feb 2012
Location: Canada, Quebec
Distribution: CentOS
Posts: 3

Rep: Reputation: Disabled
Start on boot a Node.js Server

exomic wrote:

I'm running a Centos 6.3 server and I want to start my Websocket server on startup. For that I need to run a screen session and within the session run the command
node websocketServer.js
So I tried adding this line at the end of rc.local:

su websocket -c "screen -S ws -d -m /var/includes/websocket/"
In :
cd /var/includes/websocket; node websocketServer.js; is executable

Any help?

PS: The command is working fine in shell as root
Old 09-06-2012, 03:14 PM   #2
Registered: Apr 2006
Location: Montreal,Quebec
Distribution: Gentoo
Posts: 825

Rep: Reputation: 129Reputation: 129
I suggest making an init script instead of using rc.local. Take a look at scripts in /etc/init.d, make your own and add it to the boot process (level 3 and 5). We will go from there.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to start mysql server & apache server at startup and then tomcat at last at boot sanjay87 Linux - Server 5 06-16-2012 08:19 AM
Two node cluster, start CMAN fence the other node DevinXu Linux - Enterprise 1 06-21-2010 12:37 PM
Home made cluster node fails to start sometimes on account of nfs Pier Linux - Server 2 03-24-2010 05:13 AM
How to make a DRBD node start itself as a primary node automatically? pyruby Linux - Newbie 1 01-29-2010 12:41 PM
Can't start X server when boot akhorus Fedora 7 06-17-2008 06:42 PM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 08:02 PM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration