On Wed, Oct 10, 2012 at 10:11 AM, Arun Venkataswamy <[email protected]> wrote:

>
> I have a headless Ubuntu 12.04 server and I have a C application which has
> to run on system startup *AND* the C application has to have access to an
> USB keyboard. I am using a small USB numeric keyboard.

Is it interactive that it requires a keyboard?  Can it be modified to
remove this hardware requirement?

> The program need not
> run in the background as it is the only program which will be running.

If it is not interactive and is supposed to be *always* running, then
it is better to run it as a daemon and redirect it's output to a log
file like all other daemons do.   The log file location and file perms
is up to you if want to give access to non root users to read it's
content.

For input it you could program it to take it from a FIFO file.

You could hack an init script wherein you redirect std out/err to a
logfile(s) and run the program in the background like
[  -x /usr/local/bin/myCprog  ] && /usr/local/bin/myCprog
1>/var/log/myCprog.log 2>&1   &

Don't forget to create a log rotate conf file to rotate the log files.

> It would be great if it can run on tty0 and allow getty to run on other tty's
> for debugging. Is this possible?

I suppose so.   Just like you can redirect kernel logs to a tty + log files.

> Some searching on the net gave me
> directions, but would like to hear from somebody on the list who can help.
>

Let us know your final solution.

-- Arun Khan
_______________________________________________
ILUGC Mailing List:
http://www.ae.iitm.ac.in/mailman/listinfo/ilugc

Reply via email to