I'm running Arch-Linux ARM on a Raspberry Pi.
My project goal is to have a barcode scanner attached to the Pi that forwards the scanned messages to a server in a LAN.
To harden the system against power outages etc. and minimize required user interaction, I wish to set it up so that a certain user is logged in automatically at startup (done and works) and a specific program is to be run at startup (done and works but not as intended).
I've done this so far by adding
exec mono scannerSoftware.exe 127.0.0.1 1234 randomString
to /home/certainUser/.bash_profile so it gets executed only once even when I'm switching back and forth to root (in contrast to bashrc).
The particular problem I am having: When I launch the system, it works as intended (login as certainUser, starting scannerSoftware.exe); BUT if I want to switch users and hit Ctrl+C, it restarts the login process, logging certainUser in again and running the program again => back to where I came from.
My guess as to why this happens is that the sys detects "login not complete, better start it again".
I could circumvent this by spamming Ctrl+C right around the login so that I practically interrupted it. Of course, this is not good practice. Suffice it to say it is not practical at all.
My question:
How can I set it up so the program gets executed AFTER login is complete so that Ctrl+C'ing out brings me to a normal bash prompt as certainUser instead of beginning the endless login-cycle?
EDIT:
I'm not using any graphical interface or such, only commandline (bash on tty), because when done the system won't even have a display.
therefore I need the app/service to caputre std and not run in the background. – Mark Feb 27 '14 at 12:45
The device in question together with some clones will be deployed in an industrial environment. The people who will use it have no understanding of the inner workings etc. all they want is that their scan data goes to the right magic place, no questions asked. Therefore I want the device to steer itself to the working point of the app once it gets booted, so people will switch power on, wait a minute and scan and the desired things will happen. There won't be any screen attached to it or anything. – Mark Feb 27 '14 at 13:37