initctl: job failed to start

Asked by prakash.P

Below is my script which throws "initctl: Job failed to start" when i tried to run using the command "sudo initctl start sample" on linux machine. What can be the problem?
Sometimes i get post-stopped. Please anyone help me to sort this out.

NOTE: Existing solutions did't help me.

start on stopped rc RUNLEVEL=[345]
stop on starting rc RUNLEVEL=[!3]
console output
respawn
post-stop exec sleep 10

env LD_LIBRARY_PATH="/home/prakash/lib"
env DAEMON="/home/prakash/PRES -f /home/prakash/kamailio_Presence.cfg"

#Please note if the binary name length exceeds 15 characters, then give the fist 15 cahracters of binary name in the below pkill command.
#Otherwise pkill will not work.
env PKILL="pkill PRES"

pre-start script
su -s /bin/sh -c "$DAEMON" prakash
end script

pre-stop script
/bin/sh -c "$PKILL"
end script

script
sleepWhileAppIsUp(){
   while pidof $1 >/dev/null; do
      sleep 1
         done
}

sleepWhileAppIsUp $DAEMON
end script

Question information

Language:
English Edit question
Status:
Expired
For:
upstart Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
prakash.P (prakash.gibbi) said :
#1

OS: Linux voipmysql1 2.6.32-220.el6.x86_64 #1 SMP Wed Nov 9 08:03:13 EST 2011 x86_64 x86_64 x86_64 GNU/Linux

Revision history for this message
Launchpad Janitor (janitor) said :
#2

This question was expired because it remained in the 'Open' state without activity for the last 15 days.