I am using ruby on rails application to implement chat. I am not able to setup juggernaut server in production mode.
I followed this guide to setup redis. and its working perfectly fine.
Then I followed this for setting up juggernaut. But when I am trying to start juggernaut its not working.
Here is the out for grep commands to check that redis is working but juggernaut is not.
When I am trying to stop/start redis server its gives me output ie:
Starting/Stopping redis-server: redis-server.
But nothing when i m doing the same for juggernaut. Check screenshot.
Some other things to check what actually going on:
Executable file permissions to /etc/init.d/juggernaut file -- YES
-rwxr-xr-x 1 fizzy fizzy 1310 Sep 19 11:06 juggernaut
PIDFILE=/var/run/juggernaut.pid' is defined. Does that exist? --- NO
In the 'start' part it runs 'chown juggernaut:juggernaut'. Does the user juggernaut exist and is it member of the group juggernaut? -- YES/YES
cat /etc/group redis:x:1002: juggernaut:x:113: groups juggernaut juggernaut : juggernaut
Running sudo juggernaut start the server, but i want to it to keep on running in background process/service.
I am stuck now. Can anybody help me.
EDIT
fizzy@li136-198:~$ sudo ls -l /usr/bin/juggernaut
ls: cannot access /usr/bin/juggernaut: No such file or directory
fizzy@li136-198:~$ sudo ls -l /usr/local/bin/juggernaut
lrwxrwxrwx 1 root root 40 Sep 20 02:48 /usr/local/bin/juggernaut -> ../lib/node_modules/juggernaut/server.js
I tried changing
DAEMON=/usr/bin/juggernaut
to
DAEMON=/usr/local/bin/juggernaut
after that i tried restarting the juggernaut using
sudo /etc/init.d/juggernaut start
Server started but not as background process/service.
EDIT
Running script in debuggin mode:
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/usr/bin/juggernaut
+ NAME=Juggernaut2
+ DESC=Juggernaut2
+ PIDFILE=/var/run/juggernaut.pid
+ test -x /usr/bin/juggernaut
+ exit 0
EDIT
fizzy@li136-198:~$ sudo /etc/init.d/juggernaut start
+ PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
+ DAEMON=/usr/local/bin/juggernaut
+ NAME=Juggernaut2
+ DESC=Juggernaut2
+ PIDFILE=/var/run/juggernaut.pid
+ test -x /usr/local/bin/juggernaut
+ set -e
+ case "$1" in
+ echo -n 'Starting Juggernaut2: '
Starting Juggernaut2: + touch /var/run/juggernaut.pid
+ chown juggernaut:juggernaut /var/run/juggernaut.pid
+ start-stop-daemon --start --quiet --umask 007 --pidfile /var/run/juggernaut.pid --chuid juggernaut:juggernaut --exec /usr/local/bin/juggernaut
20 Sep 06:41:16 - Your node instance does not have root privileges. This means that the flash XML policy file will be served inline instead of on port 843. This will slow down initial connections slightly.
20 Sep 06:41:16 - socket.io ready - accepting connections
node.js:134
throw e; // process.nextTick error, or 'error' event on first tick
^
Error: EADDRINUSE, Address already in use
at Server._doListen (net.js:1106:5)
at net.js:1077:14
at Object.lookup (dns.js:153:45)
at Server.listen (net.js:1071:20)
at Object.listen (/usr/local/lib/node_modules/juggernaut/lib/juggernaut/server.js:51:21)
at Object.listen (/usr/local/lib/node_modules/juggernaut/lib/juggernaut/index.js:9:10)
at Object.<anonymous> (/usr/local/lib/node_modules/juggernaut/server.js:21:12)
at Module._compile (module.js:402:26)
at Object..js (module.js:408:10)
at Module.load (module.js:334:31)
+ echo failed
failed
+ exit 0
Here is the out for all the used ports
tcp 0 0 localhost.localdom:9312 *:* LISTEN
tcp 0 0 localhost.localdo:mysql *:* LISTEN
tcp 0 0 *:6379 *:* LISTEN
tcp 0 0 *:http-alt *:* LISTEN
tcp 0 0 *:www *:* LISTEN
tcp 0 0 localhost.localdo:52433 *:* LISTEN
tcp 0 0 *:ssh *:* LISTEN
tcp 0 0 localhost.localdo:53784 *:* LISTEN
tcp 0 0 *:smtp *:* LISTEN
tcp6 0 0 [::]:ssh [::]:* LISTEN
root:root
.