> Hi, I tried to follow the instructions here, but apparently it still
>> work for me.
>> I compiled my C program from bitbake on ubuntu and I did ipkg install on
>> My program name is "getDate" and I want to run it on start up too.
>> following is my shell script (myApp.sh) placed in /etc/init.d/
>> case "$1" in
>> date -s 050109032008.00
>> /getDate > /home/root/shell_5
>> # sh /home/root/shell_5
>> exit 1
>> exit 0
Put in the full absolute path name for your program, or get rid of the
leading / on /getDate. So, where you call your program, use
/usr/bin/getDate instead of just /getDate (the latter indicates getDate is
located in the root directory, which is not correct).
Also, is /home/root/shell_5 a file or a script? If you want to pass the
output of getDate as a parameter to a script, you should use the pipe
instead of the greater than. For example:
/usr/bin/getDate | /home/root/shell_5.
However, if getDate is creating a new script file for you, then your
original is correct.
what I want to do was to execute the program, put the output to another
>> shell script and then execute the shell script after that.
>> and I found out that the program "getDate" was located on /usr/bin.
>> is the path that I write correct? I put up the link on /etc/rc5.d too, but
>> when i tried to execute it, it does not work. Is it because my shell
>> file has wrong path?
>> root@...:/etc/rc5.d$ ln -s ../init.d/myApp.sh S92myApp
>> root@...:/etc/rc5.d$ ls -a
>> . S20boa S20syslog S30ntpdate S90i2c
>> .. S20dbus-1 S23bluetooth S50bonjour S92myApp
>> S10dropbear S20ntpd S25alsa-state S65cron S99rmnologin
>> root@...:/etc/rc5.d$ S92myApp
>> -sh: S92myApp: not found
>> I dont know why S92myApp is not found. I tried to google it, but I'm still
>> quite lost in this.
>> Can anyone give me some guidance?
>> Thanks :)
In *nix, any time you call a program without a path name, it assumes that
the file is in your PATH environment variable. To execute programs that are
not located somewhere in PATH, you need to put a dot-slash in front of it.
So, your would type in the following at the command line:
if S92myApp is a script you wrote, make sure that it has the necessary
permissions to execute. if you do an ls -l, you should see the
permissions. Make sure that it says at least r-x------ (readable and
writable by the owner), and has the user name as root (since you're running
your script as root). If you need to change the permissions, do so using
the following command:
root@...:/<yourdirectory>$ chmod u+x S92myApp
Hope this helps!
Microsoft is not the answer.
Microsoft is the question.
"No" or "Linux" is the answer.