shell script - resque

Kaushal Shriyan kaushalshriyan at gmail.com
Mon May 31 17:56:23 UTC 2010


On Mon, May 31, 2010 at 6:56 PM, Kaushal Shriyan
<kaushalshriyan at gmail.com>wrote:

>
>    1. Hi,
>
> The below init scripts work fine while running it by hand but does not come up after booting up. I have ran update-rc.d resque defaults on Ubuntu Hardy Server (8.04)
>
>
> Please suggest/guide.
>
>
>    1.
>    2. #!/bin/bash
>    3. # Startup script for Resque Server
>
>    4.
>    5. start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh
>
>
>    6. stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh
>    7.
>
>    8. start() {
>    9.         echo -n "Starting ResqueServer: "
>
>    10.
>            ${start_resque}
>    11.         echo "done."
>    12. }
>    13.
>    stop() {
>    14.         echo -n "Shutting down ResqueServer: "
>
>    15.
>            ${stop_resque}
>    16.         echo "done."
>    17. }
>    18.
>
>    19. # See how we were called
>    20.
>    case "$1" in
>    21.
>      start)
>    22.         start
>    23.         ;;
>    24.
>      stop)
>    25.         stop
>    26.         ;;
>    27.
>      restart)
>
>    28.         stop
>    29.         sleep 10
>    30.
>            start
>    31.         ;;
>    32.   *)
>    33.
>            echo "Usage: $0 {start|stop|restart}"
>
>    34. esac
>
>   Hi Again,

I run the resque init script using /etc/init.d/resque start at the
command line which works perfectly fine while the machine is up and
running fine, The issue is it doesnot come up automatically after
bootup.
root at hoststage:~# cat /etc/init.d/resque
- Show quoted text -

- Show quoted text -

root at hoststage:~# cat /usr/local/AddressBook/EntAddressBookDataStore/

current/resque_cluster_start.sh
#!/bin/bash

cd /usr/local/AddressBook/EntAddressBookDataStore/current/
RAILS_ENV=production ./resque_start.sh > log/resque.1.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.2.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.3.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.4.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.5.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.6.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.7.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.8.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.9.log 2>&1 &
RAILS_ENV=production ./resque_start.sh > log/resque.10.log 2>&1 &
root at hoststage:~# ls -l /usr/local/AddressBook/EntAddressBookDataStore/

current/resque_cluster_start.sh
-rwxr-xr-x 1 root root 724 2010-05-31 04:50 /usr/local/AddressBook/

EntAddressBookDataStore/current/resque_cluster_start.sh

#cat resque_start.sh
#!/usr/bin/env sh

# === GC settings =============
# twitter's settings
# TODO - set only for the forked process not the parent process
# export RUBY_HEAP_MIN_SLOTS=500000
# export RUBY_HEAP_SLOTS_INCREMENT=250000
# export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1
# export RUBY_GC_MALLOC_LIMIT=50000000
# ============================

# required to start the redis server:
# redis-server <path to redis.conf>

# VVERBOSE=true level of verbosity - useful for debugging
# QUEUE=<value> the named queue to be polled
# INTERVAL=<seconds> the interval to sleep if there is no job in the
queue

# INTERVAL=60
QUEUE=contact_import /usr/bin/env rake -f /usr/local/AddressBook/
EntAddressBookDataStore/current/Rakefile resque:work #--trace

# start the redis-web app
#resque-web -p8282 config/initializers/load_resque.rb

# if [ -f "/usr/local/redis/redis.conf" ]; then
#     /usr/local/redis/redis.conf/redis-server /usr/local/redis/
redis.conf
# else
#     /usr/local/redis/redis.conf/redis-server /usr/local/redis/
redis.conf
# fi

root at hoststage:/etc/rc2.d#
lrwxrwxrwx 1 root root  23 2010-05-27 06:06 S20nvidia-kernel -> ../
init.d/nvidia-kernel
lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -> ../init.d/
resque
lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web -> ../init.d/
resque_web
root at hoststage:/etc/rc3.d# ls -l
total 4
lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -> ../init.d/
resque
lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web -> ../init.d/
resque_web
root at hoststage:/etc/rc3.d#
total 4
lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -> ../init.d/
resque
lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web -> ../init.d/
resque_web
root at hoststage:/etc/rc2.d#
total 4
lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -> ../init.d/
resque
lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web -> ../init.d/
resque_web
root at hoststage:/etc/rc4.d#
total 4
lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -> ../init.d/
resque
lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web -> ../init.d/
resque_web
root at hoststage:/etc/rc5.d#

Please suggest further.

Thanks and Regards

Kaushal
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.ubuntu.com/archives/ubuntu-users/attachments/20100531/76d8b4f1/attachment.html>


More information about the ubuntu-users mailing list