Re: Application starting from boot-up



Robert Scott wrote:

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.

man syslog

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.

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
<reboot>

JB
.



Relevant Pages

  • Re: misc/149335: shell script runs on Linux but not on freebsd
    ... to develop a smarter install script. ... Even if I correct the shell calls ... Looks like the Linux emulator is only 32 bit. ... I would like to see if I can get the x64 to install but if not I think the ...
    (freebsd-questions)
  • Re: misc/149335: shell script runs on Linux but not on freebsd
    ... One last observation I have made regarding this bundle installer. ... Even if I correct the shell calls ... extract it and place it in the location where the shell script would place ... Looks like the Linux emulator is only 32 bit. ...
    (freebsd-questions)
  • Re: serial fileevent on fedora core 3
    ... I tried some port swapping and instrument swapping and at ... string in response to a pushed button on another acquisition board. ... Maybe window's shell is ... different from the shell for Linux since the same code does not seem to ...
    (comp.lang.tcl)
  • Re: Application starting from boot-up
    ... When the application is started manually, this message appears on the Shell ... port, which is the main serial port on the board. ... want to copy in an update (using the cp command from a flash memory stick), ... the usual recommended way to develop an application for a system that has Linux ...
    (comp.os.linux.embedded)
  • Re: How to set /etc/fstab again after system has started
    ... switching directories and command history are superior to bash. ... on a Linux desktop somewhere. ... that shell prompt become somewhat more important. ... the current directory and run an unzip script on them. ...
    (comp.os.linux.misc)