Tiny Core Linux

General TC => Remasters / Remixes - Unofficial => Topic started by: m2 on September 19, 2011, 04:19:48 AM

Title: Run a script after booting up
Post by: m2 on September 19, 2011, 04:19:48 AM
I have a problem that can't find a solution how to run small script after tiny core is boot up in desktop.

Tryed this: (in bootlocal.sh)
----
sudo cp /opt/open.sh /usr/sbin
at now + 3 minutes < sudo –u tc open.sh &
#sudo -u tc open.sh &
----
last two commands isn't to do the trick...
(I want to do some things in tc user desktop... or after desktop has loaded up... also I want run that script only once at after boot...)

At manually everything is fine when in desktop open aterm and hit open.sh & ... thats OK, but want to automate that.

Thanks,
Title: Re: Run a script after booting up
Post by: coreplayer2 on September 19, 2011, 05:24:36 AM
Sometimes I feel commanding a script is hit or miss, however 

this usually works

in bootlocal.sh  if required late in the boot process

sleep 5
/path/to xx.sh
Title: Re: Run a script after booting up
Post by: vitex on September 19, 2011, 05:45:05 AM
at now + 3 minutes < sudo –u tc open.sh &

Try

    echo sudo -u tc open.sh | at now + 3
Title: Re: Run a script after booting up
Post by: curaga on September 19, 2011, 06:46:53 AM
.X.d

Please read the FAQ.
Title: Re: Run a script after booting up
Post by: coreplayer2 on September 19, 2011, 10:28:42 AM
I always feel like the FAQ's leaves me searching for more info... 

I mean  "opera &"  ??   for someone who already knows the answers this maybe all they need, but for someone new to tc could naturally need a few more examples...  Just imagine all the possibilities here??   I remember searching for answers to questions like "well how about a script?" is the script expected to be found in a specific location? is path important? is the file extension important?  etc. etc..

just saying is all..  :)
Title: Re: Run a script after booting up
Post by: curaga on September 19, 2011, 10:59:53 AM
It's standard unix execution, just as if typed in a terminal.
Title: Re: Run a script after booting up
Post by: gerald_clark on September 19, 2011, 12:57:51 PM
It is not TC's aim to teach basic Linux or Shell scripting.
TC is a tool set, and craftsmen are expected to know how to use their tools.
Title: Re: Run a script after booting up
Post by: m2 on September 20, 2011, 12:23:18 AM
Hi, and thanks to all about answers.

I tested and put those given commands in bootload.sh  but that wasn't to solutions. In some cases (coreplayer2) command was run by sudo(root) and that isn't do the trick because script that I want to run must drive in tc user after desktop is up. And others command wasn't work in right way for my needs (vitex). Anyway thanks to all...

Yes, solution was one again in FAQ... actually found it in here, http to wiki.tinycorelinux.net/wiki:the_boot_process
curagas hint to .X.d  or /home/tc/.X.d/ was right place to put that script file to run way that I need.

Some tune...
I also tryed put run command straight end of /usr/bin/xsetup.sh file put that wasn't solution. Because I actually try to made livecd for my teaching course needs and wanted hide that my scripts little more from students... now it is easier find from tc user home directory even it is "hidden" in .X.d directory... but you can see it right away with ls -la command...
Title: Re: Run a script after booting up
Post by: coreplayer2 on September 21, 2011, 11:08:34 PM
I think the wiki is great, it's answered a lot of questions for me..    Was just saying that maybe the FAQ's could be merged with the wiki to provide a stop avenue for learning and resolutions..