Application starting from boot-up

So far I have been testing my application on this Embest ARM board by manually starting it up from the Shell port. (Linux comes pre-installed on this board.) Today I tried to make it start automatically on boot-up, and it worked, but I'm not sure I'm doing it the right way. Here is what I did:

There is a start-up script in /etc/init.d/rcS. I edited that start-up script to include an invocation of my application. As a test, I included within the application an initial call to printf:

printf("\r\nWe are starting up\r\n");

When the application is started manually, this message appears on the Shell port, which is the main serial port on the board. But when my application is started from /etc/init.d/rcS script, then this message does not appear. This is an inconvenience, because I have several startup error messages that might be generated from my application if certain inits fail. These messages will not be very useful if they never appear.

The second problem is of more concern to me. I don't know how to interrupt the boot process in case my application bombs. And even if it doesn't bomb, and I want to copy in an update (using the cp command from a flash memory stick), I can't do it while the program is running because the executable is busy. I was able to issue a killall Shell command for my application and stop it so I could unlock the executable for updating. So I can make do. But I wonder if this is the usual recommended way to develop an application for a system that has Linux pre-installed and where I do not want to make any changes to the underlying pre-installed system.

Robert Scott Ypsilanti, Michigan

Reply to
Robert Scott
Loading thread data ...

man syslog

That is why the scripts in /etc/init.d are understanding parameters. So rcS will start the other scrips with parameter "start" and you can stop them "/etc/init.d/myjob stop"

Other way would be (if "/bin/exec" is your currently running program): $ mv -f /bin/saved_excec $ mv /bin/exec /bin/saved_excec $ mv updated/exec /bin/exec

JB

Reply to
Juergen Beisert

Le Fri, 18 Jan 2008 15:17:00 +0000, Robert Scott a écrit:

to

is

be

playing with rcS is more complicated, why not use inittab instead ? for example, mounting fat file system lies on SD/MMC at boot up mmc_mount:3:wait:/bin/mount -t vfat -o noatime,sync /dev/mmc0 /mnt/0

openlog() and syslog() in strategic places to be able to "cat /var/log/messages" obviously, /var is mounted on flash.

OTH.

--
HBV
Reply to
Habib Bouaziz-Viallet

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.