I have a script which I want to run from init.d in Raspberry Pi, I put the script in rc5.d to make it executed when runlevel 5 is being run, with order number of 20. (S20myscript)
Inside my script I used cat and grep command.
When I reboot the raspberry, it print out error similar to these :
sh: 1: cat: not found
sh: 2: grep: not found
But, If I put it in rc.local. It works. But, I don't want to put it in rc.local. I find that it's not neat,.... Also, in my experiences sometimes it won't run if I put it in rc.local.
I suspected that it is because the cat and grep commands are not ready yet ? But runlevel 5 is the last level right ?
This makes me wonder what runlevel did rc.local run on...
Please let me know if I missed something.