I have a custom written application that runs on a embedded setup (buildroot). My application has to run every time the target device boots up and so I wrote an init script to do this and it works fine. However, part of the application has a very basic 'GUI' written with ncurses. The problem I have is that it works fine when I log onto directly or over ssh, but when the binary starts through init, I am unable to access the functionality of the ncurses code. I presume that this is because the console I am logged into is not the same as the console that starts the binary. So my question is do applications/daemons have an associated console, and if so, is there any way to transfer it to another console?If not are there any other ways I could go about solving this problem? I was thinking perhaps enforcing an automated login and then getting the application to start through the login console so that when a monitor is attached to the device at least the GUI will be accessible.Or is there a better way?
Using ncurses for basic GUI on a process started inside an init script
terminal;embedded;gui;busybox;ncurses
I'm no quite sure I've understood your problem. I assume that your application starts some kind of curses GUI and you wan't to log in remotely and the - somehow - connect to that GUI (but the application is already running). I suggest to use screen (http://www.gnu.org/software/screen/) to start the application on a detached 'screen' (actually a pseudo tty with a simple terminal emulator). Then after logging in, your user(s) can use 'screen -D -r' or variations thereof to attach to virtual screen. That would be what you called to transfer it to another consolePS: Another way to do that right would possibly be to seperate service (the part that is always running) and UI into 2 seperate processes. Might be too much hassle, though, since it requires to invent some kind of IPC between those two processes.