View Single Post
Posts: 146 | Thanked: 149 times | Joined on Apr 2010
#1
Hi,

I am struggling now for over 12 hours with a problem of starting my application after the boot.

I have created scripts and saved them in following locations:

/etc/init.d/imhere
/etc/init.d/imhere_run_later

then I have used "ln -s" command to create a link to /etc/init.d/imhere from /etc/rc2.d/S99imhere

Unfortunately my application did not start. I started playing around with those files in init.d and finally ended up with following:

/etc/init.d/imhere:
Code:
#!/bin/sh

echo "IMHERE INIT CALLED" >> /home/user/startuplog

case "$1" in
  start)
    echo "IMHERE INIT START CALLED" >> /home/user/startuplog
    /etc/init.d/imhere_run_later &
	;;
  *)
esac

echo "IMHERE INIT EXITING" >> /home/user/startuplog
exit 0
/etc/init.d/imhere_run_later:
Code:
echo "ENTERED RUN_LATER" >> /home/user/startuplog
sleep 1
echo "SLEPT 1" >> /home/user/startuplog
sleep 1
echo "SLEPT 2" >> /home/user/startuplog
sleep 1
echo "SLEPT 3" >> /home/user/startuplog
sleep 1
echo "SLEPT 4" >> /home/user/startuplog
sleep 1
echo "SLEPT 5" >> /home/user/startuplog
sleep 1
echo "SLEPT 6" >> /home/user/startuplog
sleep 1
echo "SLEPT 7" >> /home/user/startuplog
sleep 1
echo "SLEPT 8" >> /home/user/startuplog
sleep 1
echo "SLEPT 9" >> /home/user/startuplog
sleep 1
echo "SLEPT 10" >> /home/user/startuplog
sleep 10
echo "SLEPT 20" >> /home/user/startuplog
sleep 10
echo "SLEPT 30" >> /home/user/startuplog
sleep 10
echo "SLEPT 40" >> /home/user/startuplog
sleep 10
echo "SLEPT 50" >> /home/user/startuplog
sleep 10
echo "SLEPT 60" >> /home/user/startuplog
sleep 10
echo "SLEPT 70" >> /home/user/startuplog
sleep 10
echo "SLEPT 80" >> /home/user/startuplog
sleep 10
echo "SLEPT 90" >> /home/user/startuplog
sleep 10
echo "SLEPT 100" >> /home/user/startuplog
sleep 10
echo "SLEPT 110" >> /home/user/startuplog
sleep 10
echo "SLEPT 120" >> /home/user/startuplog
sleep 30
echo "SLEPT 150" >> /home/user/startuplog
sleep 30
echo "SLEPT 180" >> /home/user/startuplog
echo "NOT SLEEPING ANYMORE" >> /home/user/startuplog
/usr/bin/imhere &
echo "APP SHOULD BE STARTED BY NOW" >> /home/user/startuplog
exit 0
I created symbolic links for ever /etc/rc?.d/ folder

I have modified also /etc/init.d/hulda by adding at the beggining of the file following piece of code:
Code:
echo "HULDA INIT" >> /home/user/startuplog
After emptying /home/user/startuplog and rebooting my device the file /home/user/startuplog contains only text "HULDA INIT".

If I run myself the script /etc/init.d/imhere from terminal, the startuplog file will fill up with "SLEPT..." and the other echoed text as expected and /usr/bin/imhere starts running.

Question is: Why my own scripts are not called/executed at startup?

Thanks in advance.

Last edited by rachol; 2010-04-15 at 13:02.