Originally Posted by billysdomain
Could someone be so kind as to give me an example of how i would write an inittab entry which would run a program on boot with sdtin and stdout being redirected to an already established serial terminal?
myprog:2345:respawn:/usr/bin/myprog > ttyS0 < ttyS0
That would be great, im a windows man missing an autoexec file at the moment :-(
Does it need to run from inittab?
You might do better to create a script to start it in /etc/init.d and creating a symling in /etc/rc#.d where # is the runlevel you want the program to run in. If you want it in multiple runlevels, put it in each that it would apply to, eg: rc2.d, rc3.d, rc4.d, etc. The symlink should follow the naming convention S(number)(scriptname), like S95myprog
The scripts are ran in numerical order, so put it where you want it in the startup sequence.
As for terminal redirection, you can combine stderr and stdout using 2>&1. I'm not very great at terminal redirection to serial, but you can try playing with named pipes. Try 'man mkfifo' and see if that info helps.