Tiny Core Linux
Tiny Core Base => TCB Q&A Forum => Topic started by: mbertrand on April 09, 2013, 07: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?
-
.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.
-
Is it possible that my program in .x.d is executed before bootlocal is finished?
-
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?
-
Hi mbertrand
Try setting the setuid in the same file that launches your QT program.
-
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.
-
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.
-
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.
-
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!
-
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.
-
Ok thanks.