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
/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.
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?
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.