WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Autologin question  (Read 1908 times)

Offline georgp24

  • Jr. Member
  • **
  • Posts: 58
Autologin question
« on: November 21, 2013, 11:16:26 AM »
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?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Autologin question
« Reply #1 on: November 21, 2013, 11:20:06 AM »
You likely have something in /opt/bootlocal.sh that is overwriting the "Hello" that is being output by your .profile.

Offline georgp24

  • Jr. Member
  • **
  • Posts: 58
Re: Autologin question
« Reply #2 on: November 21, 2013, 02: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?

Offline theYinYeti

  • Full Member
  • ***
  • Posts: 177
    • YetI web site
Re: Autologin question
« Reply #3 on: November 21, 2013, 11:34:28 PM »
Add .profile to the backup?

Offline georgp24

  • Jr. Member
  • **
  • Posts: 58
Re: Autologin question
« Reply #4 on: November 22, 2013, 02: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.

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10982
Re: Autologin question
« Reply #5 on: November 22, 2013, 03: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.
The only barriers that can stop you are the ones you create yourself.

Offline georgp24

  • Jr. Member
  • **
  • Posts: 58
Re: Autologin question
« Reply #6 on: November 22, 2013, 11:31:13 AM »
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.