From: kaushal on
Hi,

I have the below init.d bash shell script. While i run it by hand it
works perfectly fine, but does not start automatically after boot up.
I have run the command update-rc.d resque defaults on Ubuntu Linux
Server 8.04 (Hardy). Also i see contents of uptime command in /root/
status file too.

Please suggest/guide.

#!/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
From: S. Anthony Sequeira on
On 31/05/10 15:10, kaushal wrote:
> start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/
> resque_cluster_start.sh

Is this in a separate mount point?

If so, is it available when the init script runs?

--
S. Anthony Sequeira
++
Please, Mother! I'd rather do it myself!
++
From: kaushal on
On May 31, 9:36 pm, "S. Anthony Sequeira" <nob...(a)127.0.0.1> wrote:
> On 31/05/10 15:10, kaushal wrote:
>
> > start_resque=/usr/local/AddressBook/EntAddressBookDataStore/current/
> > resque_cluster_start.sh
>
> Is this in a separate mount point?
>
> If so, is it available when the init script runs?
>
> --
> S. Anthony Sequeira
> ++
> Please, Mother!  I'd rather do it myself!
> ++

Hi Anthony,

Its on the same mount point on the same host.

Any further suggestion ?

Thanks,

Kaushal
From: Thomas 'PointedEars' Lahn on
kaushal wrote:

> Thomas 'PointedEars' Lahn wrote:
>> [...]
>> You have not told how you run this script when not booting. You might be
>> running it with `bash resque' or `sh resque', or `. resque'; in which
>> case it would be the shell that runs it, while on boot it must run
>> itself.
>>
>> ISTM you do not really have a problem with shell scripting, so this is
>> off-topic here. Look for Ubuntu user forums instead.
>>
>> However, before you do that, make sure that a proper symlink exists in
>> /etc/rc${DEFAULT_RUNLEVEL}.d/ where $DEFAULT_RUNLEVEL as defined in
>> /etc/inittab should be one of 2, 3, 4, or 5 (if you want to keep
>> `default'). Then make sure that the file it refers to has at least `chmod
>> u+rx' (at least 0600) and `chown root.root'.
>> [...]
>
> I run the resque init script using /etc/init.d/resque start at the
> command line

That still doesn't say *how* you run it.

> which works perfectly fine while the machine is up and
> running fine, The issue is it doesnot come up automatically after
> bootup.

I am already aware of the issue.

> [...]
> root(a)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
> [...]

This looked good if /etc/init.d/resque{,_web} were executable or pointed to
executable files.

> root(a)hoststage:/etc/rc5.d#

So?

> Please suggest further.

Please read and adhere to what was suggested, and stop dumping core here.
This is comp.unix.shell, not comp.unix.linux.ubuntu.startup-scripts.

<http://www.catb.org/~esr/faqs/smart-questions.html>


PointedEars
From: Kenny McCormack on
In article <2923199.QXWTLkxdtW(a)PointedEars.de>,
Thomas 'PointedEars' Lahn <usenet(a)PointedEars.de> further abused the
people he pretends to be interested in helping thusly:
....
>Please read and adhere to what was suggested, and stop dumping core here.
>This is comp.unix.shell, not comp.unix.linux.ubuntu.startup-scripts.

MMmmmm, good. Can I have another helping of abuse, please, sir?

><http://www.catb.org/~esr/faqs/smart-questions.html>

Posting that stupid URL over and over isn't making you look any, um, er,
smarter...

--
> No, I haven't, that's why I'm asking questions. If you won't help me,
> why don't you just go find your lost manhood elsewhere.

CLC in a nutshell.