Tiny Core Linux

Tiny Core Base => TCB Q&A Forum => Topic started by: georgp24 on November 21, 2013, 02:16:26 PM

Title: Autologin question
Post 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?
Title: Re: Autologin question
Post by: gerald_clark on November 21, 2013, 02:20:06 PM
You likely have something in /opt/bootlocal.sh that is overwriting the "Hello" that is being output by your .profile.
Title: Re: Autologin question
Post by: georgp24 on November 21, 2013, 05:05:47 PM
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?
Title: Re: Autologin question
Post by: theYinYeti on November 22, 2013, 02:34:28 AM
Add .profile to the backup?
Title: Re: Autologin question
Post by: georgp24 on November 22, 2013, 05:37:29 AM
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.
Title: Re: Autologin question
Post by: curaga on November 22, 2013, 06:51:17 AM
Quote
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.
Title: Re: Autologin question
Post by: georgp24 on November 22, 2013, 02:31:13 PM
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.