Home > how-to, Tips & Tricks > Creating init.d script for Juggernaut

Creating init.d script for Juggernaut

The Juggernaut plugin for Ruby on Rails aims to revolutionize your Rails app by letting the server initiate a connection and push data to the client. In other words your app can have a real time connection to the server with the advantage of instant updates. Although the obvious use of this is for chat, the most exciting prospect is collaborative cms and wikis.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh -e 
APP_PATH=/home/zooz.com/current 
JUGGERNAUT_CONFIG="$APP_PATH/juggernaut.yml" 
JUGGERNAUT_PID="$APP_PATH/tmp/pids/juggernaut.pid" 
JUGGERNAUT_LOG="$APP_PATH/log/juggernaut.log" 
RAILS_ENV=production 
case $1 in 
        start) 
                echo "Starting Juggernaut ..." 
                juggernaut -d -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
        ;; 
        stop) 
                echo "Stopping Juggernaut ..." 
                juggernaut -k * -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
        ;; 
        restart) 
                echo "Juggernaut restart ..." 
                echo "Stopping Juggernaut ..." 
                juggernaut -k * -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
                echo "Starting Juggernaut ..." 
                juggernaut -d -c $JUGGERNAUT_CONFIG --pid $JUGGERNAUT_PID --log $JUGGERNAUT_LOG 
        ;; 
esac
  1. No comments yet.
  1. No trackbacks yet.