Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am developing a 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.

enter image description here

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.

enter image description here

Some other things to check what actually going on:

  1. Executable file permissions to /etc/init.d/juggernaut file -- YES

        -rwxr-xr-x 1 fizzy fizzy 1310 Sep 19 11:06 juggernaut
    
  2. PIDFILE=/var/run/juggernaut.pid' is defined. Does that exist? --- NO

  3. 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
    
  4. Running sudo juggernaut start the server, but i want to it to keep on running in background process/service.

enter image description here

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.

PS: Somebody please create proper tags for this question.

share|improve this question
    
Is the /etc/inin.d/juggernaut file the one they provided from the crib sheet you are using? Can you provide the output of ls -l /usr/bin/juggernaut ( I'm trying to see if its executable )? Line 21 of gist.github.com/1055322#file_juggernaut2_for_init.d_startup.sh checks to see if its executable and it isn't printing out that its starting up the service. –  becomingwisest Sep 20 '11 at 0:16
    
@ChristopherEvans check my edit.. –  Mohit Jain Sep 20 '11 at 7:03
add comment

1 Answer

The juggernaut program doesn't seem to daemonise itself by default, and the initscript doesn't provide parameters to make it do so. Check the output of jaggernaut --help for options regarding daemon mode, and if you find them modify the initscript to provide those. For example:

OPTIONS="--daemonize"
...
if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid juggernaut:juggernaut --exec $DAEMON -- $OPTIONS

If there aren't any options you'll have to make start-stop-daemon do the daemonising (which isn't ideal for various reasons). To do this add the --background and probably --make-pidfile options:

if start-stop-daemon --start --quiet --umask 007 --pidfile $PIDFILE --chuid juggernaut:juggernaut --background --make-pidfile --exec $DAEMON
share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.