Re: [ubuntu-uk] shell script resque
On Tue, Jun 1, 2010 at 1:25 AM, Bruno Girin brunogi...@gmail.com wrote: On Tue, 2010-06-01 at 00:12 +0530, Kaushal Shriyan wrote: On Tue, Jun 1, 2010 at 12:05 AM, Bruno Girin brunogi...@gmail.com wrote: On Mon, 2010-05-31 at 23:34 +0530, Kaushal Shriyan wrote: Hi, 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. This is because /etc/init.d is just a repository for all startup/shutdown scripts. You then need to configure the script to start on certain run-levels and stop on others. Have a look at the wiki page on the subject [1] (the section titled Installing custom init-scripts) or do: man update-rc.d [1] https://help.ubuntu.com/community/UbuntuBootupHowto Bruno r...@hoststage:~# cat /etc/init.d/resque #!/bin/bash # Author Kaushal Shriyan # Date 31/05/2010 # Startup script for Resque Server touch /root/status set -e start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh start() { echo -n Starting ResqueServer: ${start_resque} echo starting /root/status uptime /root/status echo done. exit 0 } stop() { echo -n Shutting down ResqueServer: ${stop_resque} echo done. exit 0 } # See how we were called case $1 in start) start ;; stop) stop ;; restart) stop sleep 10 start ;; *) echo Usage: $0 {start|stop|restart} esac r...@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 21 RAILS_ENV=production ./resque_start.sh log/resque.2.log 21 RAILS_ENV=production ./resque_start.sh log/resque.3.log 21 RAILS_ENV=production ./resque_start.sh log/resque.4.log 21 RAILS_ENV=production ./resque_start.sh log/resque.5.log 21 RAILS_ENV=production ./resque_start.sh log/resque.6.log 21 RAILS_ENV=production ./resque_start.sh log/resque.7.log 21 RAILS_ENV=production ./resque_start.sh log/resque.8.log 21 RAILS_ENV=production ./resque_start.sh log/resque.9.log 21 RAILS_ENV=production ./resque_start.sh log/resque.10.log 21 r...@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=50 # export RUBY_HEAP_SLOTS_INCREMENT=25 # export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 # export RUBY_GC_MALLOC_LIMIT=5000 # # 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
Re: [ubuntu-uk] shell script resque
On Tue, 2010-06-01 at 11:45 +0530, Kaushal Shriyan wrote: On Tue, Jun 1, 2010 at 1:25 AM, Bruno Girin brunogi...@gmail.com wrote: On Tue, 2010-06-01 at 00:12 +0530, Kaushal Shriyan wrote: On Tue, Jun 1, 2010 at 12:05 AM, Bruno Girin brunogi...@gmail.com wrote: On Mon, 2010-05-31 at 23:34 +0530, Kaushal Shriyan wrote: Hi, 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. This is because /etc/init.d is just a repository for all startup/shutdown scripts. You then need to configure the script to start on certain run-levels and stop on others. Have a look at the wiki page on the subject [1] (the section titled Installing custom init-scripts) or do: man update-rc.d [1] https://help.ubuntu.com/community/UbuntuBootupHowto Bruno r...@hoststage:~# cat /etc/init.d/resque #!/bin/bash # Author Kaushal Shriyan # Date 31/05/2010 # Startup script for Resque Server touch /root/status set -e start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh start() { echo -n Starting ResqueServer: ${start_resque} echo starting /root/status uptime /root/status echo done. exit 0 } stop() { echo -n Shutting down ResqueServer: ${stop_resque} echo done. exit 0 } # See how we were called case $1 in start) start ;; stop) stop ;; restart) stop sleep 10 start ;; *) echo Usage: $0 {start|stop|restart} esac r...@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 21 RAILS_ENV=production ./resque_start.sh log/resque.2.log 21 RAILS_ENV=production ./resque_start.sh log/resque.3.log 21 RAILS_ENV=production ./resque_start.sh log/resque.4.log 21 RAILS_ENV=production ./resque_start.sh log/resque.5.log 21 RAILS_ENV=production ./resque_start.sh log/resque.6.log 21 RAILS_ENV=production ./resque_start.sh log/resque.7.log 21 RAILS_ENV=production ./resque_start.sh log/resque.8.log 21 RAILS_ENV=production ./resque_start.sh log/resque.9.log 21 RAILS_ENV=production ./resque_start.sh log/resque.10.log 21 r...@hoststage:~# ls -l /usr/local/AddressBook/EntAddressBookDataStore/ current/resque_cluster_start.sh -rwxr-xr-x 1 root root 724 2010-05-31
Re: [ubuntu-uk] shell script resque
On Mon, 2010-05-31 at 23:34 +0530, Kaushal Shriyan wrote: Hi, 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. This is because /etc/init.d is just a repository for all startup/shutdown scripts. You then need to configure the script to start on certain run-levels and stop on others. Have a look at the wiki page on the subject [1] (the section titled Installing custom init-scripts) or do: man update-rc.d [1] https://help.ubuntu.com/community/UbuntuBootupHowto Bruno r...@hoststage:~# cat /etc/init.d/resque #!/bin/bash # Author Kaushal Shriyan # Date 31/05/2010 # Startup script for Resque Server touch /root/status set -e start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh start() { echo -n Starting ResqueServer: ${start_resque} echo starting /root/status uptime /root/status echo done. exit 0 } stop() { echo -n Shutting down ResqueServer: ${stop_resque} echo done. exit 0 } # See how we were called case $1 in start) start ;; stop) stop ;; restart) stop sleep 10 start ;; *) echo Usage: $0 {start|stop|restart} esac r...@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 21 RAILS_ENV=production ./resque_start.sh log/resque.2.log 21 RAILS_ENV=production ./resque_start.sh log/resque.3.log 21 RAILS_ENV=production ./resque_start.sh log/resque.4.log 21 RAILS_ENV=production ./resque_start.sh log/resque.5.log 21 RAILS_ENV=production ./resque_start.sh log/resque.6.log 21 RAILS_ENV=production ./resque_start.sh log/resque.7.log 21 RAILS_ENV=production ./resque_start.sh log/resque.8.log 21 RAILS_ENV=production ./resque_start.sh log/resque.9.log 21 RAILS_ENV=production ./resque_start.sh log/resque.10.log 21 r...@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=50 # export RUBY_HEAP_SLOTS_INCREMENT=25 # export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 # export RUBY_GC_MALLOC_LIMIT=5000 # # 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 r...@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 r...@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 r...@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 r...@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 r...@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 r...@hoststage:/etc/rc5.d# Please suggest further. Thanks and Regards -- ubuntu-uk@lists.ubuntu.com
Re: [ubuntu-uk] shell script resque
On Tue, Jun 1, 2010 at 12:05 AM, Bruno Girin brunogi...@gmail.com wrote: On Mon, 2010-05-31 at 23:34 +0530, Kaushal Shriyan wrote: Hi, 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. This is because /etc/init.d is just a repository for all startup/shutdown scripts. You then need to configure the script to start on certain run-levels and stop on others. Have a look at the wiki page on the subject [1] (the section titled Installing custom init-scripts) or do: man update-rc.d [1] https://help.ubuntu.com/community/UbuntuBootupHowto Bruno r...@hoststage:~# cat /etc/init.d/resque #!/bin/bash # Author Kaushal Shriyan # Date 31/05/2010 # Startup script for Resque Server touch /root/status set -e start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh start() { echo -n Starting ResqueServer: ${start_resque} echo starting /root/status uptime /root/status echo done. exit 0 } stop() { echo -n Shutting down ResqueServer: ${stop_resque} echo done. exit 0 } # See how we were called case $1 in start) start ;; stop) stop ;; restart) stop sleep 10 start ;; *) echo Usage: $0 {start|stop|restart} esac r...@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 21 RAILS_ENV=production ./resque_start.sh log/resque.2.log 21 RAILS_ENV=production ./resque_start.sh log/resque.3.log 21 RAILS_ENV=production ./resque_start.sh log/resque.4.log 21 RAILS_ENV=production ./resque_start.sh log/resque.5.log 21 RAILS_ENV=production ./resque_start.sh log/resque.6.log 21 RAILS_ENV=production ./resque_start.sh log/resque.7.log 21 RAILS_ENV=production ./resque_start.sh log/resque.8.log 21 RAILS_ENV=production ./resque_start.sh log/resque.9.log 21 RAILS_ENV=production ./resque_start.sh log/resque.10.log 21 r...@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=50 # export RUBY_HEAP_SLOTS_INCREMENT=25 # export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 # export RUBY_GC_MALLOC_LIMIT=5000 # # 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 r...@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 r...@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 r...@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 r...@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 r...@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 r...@hoststage:/etc/rc5.d#
Re: [ubuntu-uk] shell script resque
On Tue, 2010-06-01 at 00:12 +0530, Kaushal Shriyan wrote: On Tue, Jun 1, 2010 at 12:05 AM, Bruno Girin brunogi...@gmail.com wrote: On Mon, 2010-05-31 at 23:34 +0530, Kaushal Shriyan wrote: Hi, 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. This is because /etc/init.d is just a repository for all startup/shutdown scripts. You then need to configure the script to start on certain run-levels and stop on others. Have a look at the wiki page on the subject [1] (the section titled Installing custom init-scripts) or do: man update-rc.d [1] https://help.ubuntu.com/community/UbuntuBootupHowto Bruno r...@hoststage:~# cat /etc/init.d/resque #!/bin/bash # Author Kaushal Shriyan # Date 31/05/2010 # Startup script for Resque Server touch /root/status set -e start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh start() { echo -n Starting ResqueServer: ${start_resque} echo starting /root/status uptime /root/status echo done. exit 0 } stop() { echo -n Shutting down ResqueServer: ${stop_resque} echo done. exit 0 } # See how we were called case $1 in start) start ;; stop) stop ;; restart) stop sleep 10 start ;; *) echo Usage: $0 {start|stop|restart} esac r...@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 21 RAILS_ENV=production ./resque_start.sh log/resque.2.log 21 RAILS_ENV=production ./resque_start.sh log/resque.3.log 21 RAILS_ENV=production ./resque_start.sh log/resque.4.log 21 RAILS_ENV=production ./resque_start.sh log/resque.5.log 21 RAILS_ENV=production ./resque_start.sh log/resque.6.log 21 RAILS_ENV=production ./resque_start.sh log/resque.7.log 21 RAILS_ENV=production ./resque_start.sh log/resque.8.log 21 RAILS_ENV=production ./resque_start.sh log/resque.9.log 21 RAILS_ENV=production ./resque_start.sh log/resque.10.log 21 r...@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=50 # export RUBY_HEAP_SLOTS_INCREMENT=25 # export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1 # export RUBY_GC_MALLOC_LIMIT=5000 # # 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