<br><br><div class="gmail_quote">On Tue, Jun 1, 2010 at 12:05 AM, Bruno Girin <span dir="ltr">&lt;<a href="mailto:brunogirin@gmail.com">brunogirin@gmail.com</a>&gt;</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>
&gt; Hi,<br>
&gt;<br>
&gt;<br>
&gt; I run the resque init script using /etc/init.d/resque start at<br>
&gt; the command line which works perfectly fine while the machine is up<br>
&gt; and<br>
&gt; running fine, The issue is it doesnot come up automatically after<br>
&gt; 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 &quot;Installing custom init-scripts&quot;)<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>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; root@hoststage:~# cat /etc/init.d/resque<br>
&gt;<br>
&gt; #!/bin/bash<br>
&gt; # Author Kaushal Shriyan<br>
&gt; # Date 31/05/2010<br>
&gt; # Startup script for Resque Server<br>
&gt;<br>
&gt; touch /root/status<br>
&gt; set -e<br>
&gt;<br>
&gt; start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_start.sh<br>
&gt; stop_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/resque_cluster_stop.sh<br>
&gt;<br>
&gt; start() {<br>
&gt;         echo -n &quot;Starting ResqueServer: &quot;<br>
&gt;         ${start_resque}<br>
&gt;         echo &quot;starting&quot; &gt;&gt; /root/status<br>
&gt;         uptime &gt;&gt; /root/status<br>
&gt;         echo &quot;done.&quot;<br>
&gt;         exit 0<br>
&gt; }<br>
&gt; stop() {<br>
&gt;         echo -n &quot;Shutting down ResqueServer: &quot;<br>
&gt;         ${stop_resque}<br>
&gt;         echo &quot;done.&quot;<br>
&gt;         exit 0<br>
&gt; }<br>
&gt;<br>
&gt; # See how we were called<br>
&gt; case &quot;$1&quot; in<br>
&gt;   start)<br>
&gt;         start<br>
&gt;         ;;<br>
&gt;   stop)<br>
&gt;         stop<br>
&gt;         ;;<br>
&gt;   restart)<br>
&gt;         stop<br>
&gt;         sleep 10<br>
&gt;         start<br>
&gt;         ;;<br>
&gt;   *)<br>
&gt;         echo &quot;Usage: $0 {start|stop|restart}&quot;<br>
&gt; esac<br>
&gt; root@hoststage:~# cat /usr/local/AddressBook/EntAddressBookDataStore/<br>
&gt;<br>
&gt; current/resque_cluster_start.sh<br>
&gt;<br>
&gt; #!/bin/bash<br>
&gt;<br>
&gt;<br>
&gt; cd /usr/local/AddressBook/EntAddressBookDataStore/current/<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.1.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.2.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.3.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.4.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.5.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.6.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.7.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.8.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.9.log 2&gt;&amp;1 &amp;<br>
&gt; RAILS_ENV=production ./resque_start.sh &gt; log/resque.10.log 2&gt;&amp;1 &amp;<br>
&gt; root@hoststage:~# ls<br>
&gt; -l /usr/local/AddressBook/EntAddressBookDataStore/<br>
&gt;<br>
&gt;<br>
&gt; current/resque_cluster_start.sh<br>
&gt;<br>
&gt; -rwxr-xr-x 1 root root 724 2010-05-31 04:50 /usr/local/AddressBook/<br>
&gt;<br>
&gt; EntAddressBookDataStore/current/resque_cluster_start.sh<br>
&gt;<br>
&gt;<br>
&gt; #cat resque_start.sh<br>
&gt; #!/usr/bin/env sh<br>
&gt;<br>
&gt;<br>
&gt; # === GC settings =============<br>
&gt; # twitter&#39;s settings<br>
&gt; # TODO - set only for the forked process not the parent process<br>
&gt; # export RUBY_HEAP_MIN_SLOTS=500000<br>
&gt; # export RUBY_HEAP_SLOTS_INCREMENT=250000<br>
&gt; # export RUBY_HEAP_SLOTS_GROWTH_FACTOR=1<br>
&gt; # export RUBY_GC_MALLOC_LIMIT=50000000<br>
&gt; # ============================<br>
&gt;<br>
&gt;<br>
&gt; # required to start the redis server:<br>
&gt; # redis-server &lt;path to redis.conf&gt;<br>
&gt;<br>
&gt;<br>
&gt; # VVERBOSE=true level of verbosity - useful for debugging<br>
&gt; # QUEUE=&lt;value&gt; the named queue to be polled<br>
&gt; # INTERVAL=&lt;seconds&gt; the interval to sleep if there is no job in the<br>
&gt; queue<br>
&gt;<br>
&gt;<br>
&gt; # INTERVAL=60<br>
&gt; QUEUE=contact_import /usr/bin/env rake -f /usr/local/AddressBook/<br>
&gt; EntAddressBookDataStore/current/Rakefile resque:work #--trace<br>
&gt;<br>
&gt;<br>
&gt; # start the redis-web app<br>
&gt; #resque-web -p8282 config/initializers/load_resque.rb<br>
&gt;<br>
&gt;<br>
&gt; # if [ -f &quot;/usr/local/redis/redis.conf&quot; ]; then<br>
&gt; #     /usr/local/redis/redis.conf/redis-server /usr/local/redis/<br>
&gt; redis.conf<br>
&gt; # else<br>
&gt; #     /usr/local/redis/redis.conf/redis-server /usr/local/redis/<br>
&gt; redis.conf<br>
&gt; # fi<br>
&gt;<br>
&gt;<br>
&gt; root@hoststage:/etc/rc2.d#<br>
&gt; lrwxrwxrwx 1 root root  23 2010-05-27 06:06 S20nvidia-kernel -&gt; ../<br>
&gt; init.d/nvidia-kernel<br>
&gt; lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -&gt; ../init.d/<br>
&gt; resque<br>
&gt; lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web<br>
&gt; -&gt; ../init.d/<br>
&gt; resque_web<br>
&gt; root@hoststage:/etc/rc3.d# ls -l<br>
&gt; total 4<br>
&gt; lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -&gt; ../init.d/<br>
&gt; resque<br>
&gt; lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web<br>
&gt; -&gt; ../init.d/<br>
&gt; resque_web<br>
&gt; root@hoststage:/etc/rc3.d#<br>
&gt; total 4<br>
&gt; lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -&gt; ../init.d/<br>
&gt; resque<br>
&gt; lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web<br>
&gt; -&gt; ../init.d/<br>
&gt; resque_web<br>
&gt; root@hoststage:/etc/rc2.d#<br>
&gt; total 4<br>
&gt; lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -&gt; ../init.d/<br>
&gt; resque<br>
&gt; lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web<br>
&gt; -&gt; ../init.d/<br>
&gt; resque_web<br>
&gt; root@hoststage:/etc/rc4.d#<br>
&gt; total 4<br>
&gt; lrwxrwxrwx 1 root root  16 2010-05-31 05:19 S20resque -&gt; ../init.d/<br>
&gt; resque<br>
&gt; lrwxrwxrwx 1 root root  20 2010-05-31 05:19 S20resque_web<br>
&gt; -&gt; ../init.d/<br>
&gt; resque_web<br>
&gt; root@hoststage:/etc/rc5.d#<br>
&gt;<br>
&gt;<br>
&gt; Please suggest further.<br>
&gt;<br>
&gt;<br>
&gt; Thanks and Regards<br>
&gt;<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 -&gt; ../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>