LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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!

Notices


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

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


exomic wrote:
Hi,

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
Code:
node websocketServer.js
So I tried adding this line at the end of rc.local:

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

Any help?

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

Rep: Reputation: 128Reputation: 128
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.
 
  


Reply


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 09:19 AM
Two node cluster, start CMAN fence the other node DevinXu Linux - Enterprise 1 06-21-2010 01:37 PM
Home made cluster node fails to start sometimes on account of nfs Pier Linux - Server 2 03-24-2010 06:13 AM
How to make a DRBD node start itself as a primary node automatically? pyruby Linux - Newbie 1 01-29-2010 01:41 PM
Can't start X server when boot akhorus Fedora 7 06-17-2008 07:42 PM


All times are GMT -5. The time now is 05:58 PM.

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