WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Run a script after booting up  (Read 13715 times)

Offline m2

  • Newbie
  • *
  • Posts: 2
Run a script after booting up
« on: September 19, 2011, 07: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,
« Last Edit: September 19, 2011, 07:22:26 AM by m2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Run a script after booting up
« Reply #1 on: September 19, 2011, 08: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

Offline vitex

  • Full Member
  • ***
  • Posts: 113
Re: Run a script after booting up
« Reply #2 on: September 19, 2011, 08:45:05 AM »
at now + 3 minutes < sudo –u tc open.sh &

Try

    echo sudo -u tc open.sh | at now + 3

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Run a script after booting up
« Reply #3 on: September 19, 2011, 09:46:53 AM »
.X.d

Please read the FAQ.
The only barriers that can stop you are the ones you create yourself.

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Run a script after booting up
« Reply #4 on: September 19, 2011, 01:28:42 PM »
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..  :)

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 11044
Re: Run a script after booting up
« Reply #5 on: September 19, 2011, 01:59:53 PM »
It's standard unix execution, just as if typed in a terminal.
The only barriers that can stop you are the ones you create yourself.

Offline gerald_clark

  • TinyCore Moderator
  • Hero Member
  • *****
  • Posts: 4254
Re: Run a script after booting up
« Reply #6 on: September 19, 2011, 03: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.

Offline m2

  • Newbie
  • *
  • Posts: 2
Re: Run a script after booting up
« Reply #7 on: September 20, 2011, 03: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...
« Last Edit: September 20, 2011, 03:25:45 AM by m2 »

Offline coreplayer2

  • Hero Member
  • *****
  • Posts: 3020
Re: Run a script after booting up
« Reply #8 on: September 22, 2011, 02:08:34 AM »
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..