Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: georgp24 on November 21, 2013, 02:16:26 PM
-
I am using MicroCore and would like to start my program right after login. For a test I wrote into the file ".profile" in the home/tc directory the command: echo "Hello". (This shall be replaced by my program name later)
The "Hello" text is displayed when I enter "login" and "tc" on the command line. But it does not appear when Microcore boots and logs in the user tc automatically.
Where do I have to enter the - echo "Hello" - so it will appear right after booting?
-
You likely have something in /opt/bootlocal.sh that is overwriting the "Hello" that is being output by your .profile.
-
In my bootlocal.sh I load gpm and copy some files. Do you think the output of these commands will overwrite the "Hello" ?
I also copy my modified .profile file to /home/tc via a copy command within this bootlocal.sh script. Is this too late in the process? Is there an alternative to do this?
-
Add .profile to the backup?
-
I just enter "sudo poweroff" so I do not use backup. But yes, I could make a "mydata.tcz" that contains the .profile file. I currently do not know if that extension is installed before bootlocal.sh is executed. If not it would probably not help here.
-
I also copy my modified .profile file to /home/tc via a copy command within this bootlocal.sh script. Is this too late in the process? Is there an alternative to do this?
You should do that in bootsync.sh. Doing the copy in bootlocal causes a race: which will happen first, the login or the copy?
Extensions loaded onboot are all finished before either boot*.sh script.
-
Thank you very much for the help!
When I put my copy command into bootsync.sh, I may have made a mistake somehow, but it did not work. To avoid the mentioned race condition I made my copy command the first line in bootlocal.sh and that did work fine.