WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: TC Boot sequence  (Read 2847 times)

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
TC Boot sequence
« on: April 09, 2013, 10:48:50 AM »
When TC is booting we have in this order these scripts:

tc-config --> bootsync --> bootlocal

At what stage is .xsession executed? And when is .x.d folder processed?

I have a typical TC installation with x running. I have a QT program that is lunched on boot in the .x.d folder.
In bootlocal I set the setuid bit on the QT program. It need to run with root privileged because this pc is a controllers and accesses specific hardware (beyon this scope!). In this setup is it possible the my QT app is loaded before the setuid bit is set?

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: TC Boot sequence
« Reply #1 on: April 09, 2013, 11:03:21 AM »
.xsession is run from startx in the tc user's .profile.
It is not part of the boot up procedure.
If you read .xsession, you will see where .X.d scripts are run.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: TC Boot sequence
« Reply #2 on: April 09, 2013, 11:11:27 AM »
Is it possible that my program in .x.d is executed before bootlocal is finished?

Offline tinypoodle

  • Hero Member
  • *****
  • Posts: 3857
Re: TC Boot sequence
« Reply #3 on: April 09, 2013, 11:14:41 AM »
There would be several approaches of launching a program earlier, but you having it in X.d. now raises the suspicion that it depends on X, does it?
"Software gets slower faster than hardware gets faster." Niklaus Wirth - A Plea for Lean Software (1995)

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: TC Boot sequence
« Reply #4 on: April 09, 2013, 11:15:26 AM »
Hi mbertrand
Try setting the  setuid   in the same file that launches your QT program.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: TC Boot sequence
« Reply #5 on: April 09, 2013, 11:16:20 AM »
When I boot, tc auto logs on and therefore my .profile is executed and then startx and then .xession and then .x.d, correct?
Can all this complete before bootlocal.sh has completed.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: TC Boot sequence
« Reply #6 on: April 09, 2013, 11:20:46 AM »
bootlocal.sh runs in background, so yes it may not finish before the tc user logis in.
All programs that must run before login should be in bootsync.sh not bootlocal.sh.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: TC Boot sequence
« Reply #7 on: April 09, 2013, 11:23:12 AM »
Hi mbertrand
Try setting the  setuid   in the same file that launches your QT program.
It's not only about setting the the setuid bit I'm doing allot more stuff in there. I'm basically preparing its environment. I'm chmoding and chowning some folder and a lot more. I need to know it this script will complete before my program is loaded.

Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: TC Boot sequence
« Reply #8 on: April 09, 2013, 11:25:57 AM »
bootlocal.sh runs in background, so yes it may not finish before the tc user logis in.
All programs that must run before login should be in bootsync.sh not bootlocal.sh.
Ok this makes sense to me. So setting the setuid bit in bootsync should be ok as well as chmoding some folder?
Thanks for your help!

Offline Rich

  • Administrator
  • Hero Member
  • *****
  • Posts: 11619
Re: TC Boot sequence
« Reply #9 on: April 09, 2013, 11:27:08 AM »
Hi mbertrand
Bootlocal runs asynchronously in the background and depending on what's in there could complete at any time.
Adding the command to the file you created in .X.d will guarantee it occurs when you want it to. If your QT program
is an extension, you could place the command in the tce.installed script.


Offline mbertrand

  • Full Member
  • ***
  • Posts: 225
Re: TC Boot sequence
« Reply #10 on: April 09, 2013, 11:44:18 AM »
Ok thanks.