Running a script on front-ground on startup ?
Hi !
I would like to know how to run a BASH script on front-ground on startup of my machine. I've installed a Damn Small Linux (DSL) on a old computer and I would like to run a script at stratup, in command-line mode. So, I've added my script in /etc/rc3.d and it's working fine except 1 thing : I would like it does not execute on background. In facts, I would like the script take the hand immediatelly after login (my DSL is automatically login in with the DSLuser user). The aim is that the script take the controle of the computer until it quit (the script is launching an application, wait for its stop and shutting down the PC). Thanks ! Pit |
i think putting the script in ~/.profile or ~/.bash_profile would invoke it after login and as long as you dont put a & at the end, it wont background.
|
Quote:
I think it is possible for a boot script to start a login shell running in a virtual terminal (including the one showing console output) and running a program but I do not know the details. It would probably need bash's --login and --rcfile options. Quote:
Quote:
It might be better if you tell us what you want to do rather than ask us how to implement your solution. We may be able to suggest a better solution. |
Hi !
Thank you for your answers ! @ schneidz : Thank you very much ! Calling my script in ~/.bash_profile was the solution ! ;-) Quote:
Quote:
Quote:
When we want to stop the computer, we kill the app (CTRL+C) and then the script will automatically shutdown the computer. Here is an exemple of the script I want to use : Code:
[Here some code to wait 5 seconds so that the user can cancel the script continuation and take the hand on the computer] |
All times are GMT -5. The time now is 12:03 PM. |