<br><br><div class="gmail_quote">On Tue, Jun 1, 2010 at 12:05 AM, Bruno Girin <span dir="ltr"><<a href="mailto:brunogirin@gmail.com">brunogirin@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div class="im">On Mon, 2010-05-31 at 23:34 +0530, Kaushal Shriyan wrote:<br>
> Hi,<br>
><br>
><br>
> I run the resque init script using /etc/init.d/resque start at<br>
> the command line which works perfectly fine while the machine is up<br>
> and<br>
> running fine, The issue is it doesnot come up automatically after<br>
> bootup.<br>
<br>
</div>This is because /etc/init.d is just a repository for all<br>
startup/shutdown scripts. You then need to configure the script to start<br>
on certain run-levels and stop on others. Have a look at the wiki page<br>
on the subject [1] (the section titled "Installing custom init-scripts")<br>
or do: man update-rc.d<br>
<br>
[1] <a href="https://help.ubuntu.com/community/UbuntuBootupHowto" target="_blank">https://help.ubuntu.com/community/UbuntuBootupHowto</a><br>
<br>
Bruno<br>
<div><div></div><div class="h5"><br>
><br>
><br>
><br>
> root@hoststage:~# cat /etc/init.d/resque<br>
><br>
> #!/bin/bash<br>
> # Author Kaushal Shriyan<br>
> # Date 31/05/2010<br>
> # Startup script for Resque Server<br>
><br>
> touch /root/status<br>
> set -e<br>
><br>
> start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh<br>
> stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh<br>
><br>
> start() {<br>
> echo -n "Starting ResqueServer: "<br>
> ${start_resque}<br>
> echo "starting" >> /root/status<br>
> uptime >> /root/status<br>
> echo "done."<br>
> exit 0<br>
> }<br>
> stop() {<br>
> echo -n "Shutting down ResqueServer: "<br>
> ${stop_resque}<br>
> echo "done."<br>
> exit 0<br>
> }<br>
><br>
> # See how we were called<br>
> case "$1" in<br>
> start)<br>
> start<br>
> ;;<br>
> stop)<br>
> stop<br>
> ;;<br>
> restart)<br>
> stop<br>
> sleep 10<br>
> start<br>
> ;;<br>
> *)<br>
> echo "Usage: $0 {start|stop|restart}"<br>
> esac<br>
> root@hoststage:~# cat /usr/local/AddressBook/EntAddressBookDataStore/<br>
><br>
> current/resque_cluster_start.sh<br>
><br>
> #!/bin/bash<br>
><br>
><br>
> cd /usr/local/AddressBook/EntAddressBookDataStore/current/<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.1.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.2.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.3.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.4.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.5.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.6.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.7.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.8.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.9.log 2>&1 &<br>
> RAILS_ENV=production ./resque_start.sh > log/resque.10.log 2>&1 &<br>
> root@hoststage:~# ls<br>
> -l /usr/local/AddressBook/EntAddressBookDataStore/<br>
><br>
><br>
> current/resque_cluster_start.sh<br>
><br>
> -rwxr-xr-x 1 root root 724 2010-05-31 04:50 /usr/local/AddressBook/<br>
><br>
> EntAddressBookDataStore/current/resque_cluster_start.sh<br>
><br>
><br>
> #cat resque_start.sh<br>
> #!/usr/bin/env sh<br>
><br>
><br>
> # === GC settings =============<br>
> # twitter's settings<br>
> # TODO - set only for the forked process not the parent process<br>
> # export RUBY_HEAP_MIN_SLOTS=500000<br>
> # export RUBY_HEAP_SLOTS_INCREMENT=250000<br>
> # export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1<br>
> # export RUBY_GC_MALLOC_LIMIT=50000000<br>
> # ============================<br>
><br>
><br>
> # required to start the redis server:<br>
> # redis-server <path to redis.conf><br>
><br>
><br>
> # VVERBOSE=true level of verbosity - useful for debugging<br>
> # QUEUE=<value> the named queue to be polled<br>
> # INTERVAL=<seconds> the interval to sleep if there is no job in the<br>
> queue<br>
><br>
><br>
> # INTERVAL=60<br>
> QUEUE=contact_import /usr/bin/env rake -f /usr/local/AddressBook/<br>
> EntAddressBookDataStore/current/Rakefile resque:work #--trace<br>
><br>
><br>
> # start the redis-web app<br>
> #resque-web -p8282 config/initializers/load_resque.rb<br>
><br>
><br>
> # if [ -f "/usr/local/redis/redis.conf" ]; then<br>
> # /usr/local/redis/redis.conf/redis-server /usr/local/redis/<br>
> redis.conf<br>
> # else<br>
> # /usr/local/redis/redis.conf/redis-server /usr/local/redis/<br>
> redis.conf<br>
> # fi<br>
><br>
><br>
> root@hoststage:/etc/rc2.d#<br>
> lrwxrwxrwx 1 root root 23 2010-05-27 06:06 S20nvidia-kernel -> ../<br>
> init.d/nvidia-kernel<br>
> lrwxrwxrwx 1 root root 16 2010-05-31 05:19 S20resque -> ../init.d/<br>
> resque<br>
> lrwxrwxrwx 1 root root 20 2010-05-31 05:19 S20resque_web<br>
> -> ../init.d/<br>
> resque_web<br>
> root@hoststage:/etc/rc3.d# ls -l<br>
> total 4<br>
> lrwxrwxrwx 1 root root 16 2010-05-31 05:19 S20resque -> ../init.d/<br>
> resque<br>
> lrwxrwxrwx 1 root root 20 2010-05-31 05:19 S20resque_web<br>
> -> ../init.d/<br>
> resque_web<br>
> root@hoststage:/etc/rc3.d#<br>
> total 4<br>
> lrwxrwxrwx 1 root root 16 2010-05-31 05:19 S20resque -> ../init.d/<br>
> resque<br>
> lrwxrwxrwx 1 root root 20 2010-05-31 05:19 S20resque_web<br>
> -> ../init.d/<br>
> resque_web<br>
> root@hoststage:/etc/rc2.d#<br>
> total 4<br>
> lrwxrwxrwx 1 root root 16 2010-05-31 05:19 S20resque -> ../init.d/<br>
> resque<br>
> lrwxrwxrwx 1 root root 20 2010-05-31 05:19 S20resque_web<br>
> -> ../init.d/<br>
> resque_web<br>
> root@hoststage:/etc/rc4.d#<br>
> total 4<br>
> lrwxrwxrwx 1 root root 16 2010-05-31 05:19 S20resque -> ../init.d/<br>
> resque<br>
> lrwxrwxrwx 1 root root 20 2010-05-31 05:19 S20resque_web<br>
> -> ../init.d/<br>
> resque_web<br>
> root@hoststage:/etc/rc5.d#<br>
><br>
><br>
> Please suggest further.<br>
><br>
><br>
> Thanks and Regards<br>
><br>
<br>
<br>
<br>
</div></div><font color="#888888">--<br>
<a href="mailto:ubuntu-uk@lists.ubuntu.com">ubuntu-uk@lists.ubuntu.com</a><br>
<a href="https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk" target="_blank">https://lists.ubuntu.com/mailman/listinfo/ubuntu-uk</a><br>
<a href="https://wiki.ubuntu.com/UKTeam/" target="_blank">https://wiki.ubuntu.com/UKTeam/</a><br>
</font></blockquote></div><div><br></div><div>Hi Bruno,</div><div><br></div><div>root:~# update-rc.d resque start 51 S .</div><div> Adding system startup for /etc/init.d/resque ...</div><div> /etc/rcS.d/S51resque -> ../init.d/resque</div>
<div><br></div><div>did not work this time too</div><div><br></div><div>Please suggest</div><div><br></div><div>Kaushal</div><div><br></div>