WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: Run java script automatically at bootup  (Read 1469 times)

Offline calvino

  • WikiUser
  • *
  • Posts: 1
Run java script automatically at bootup
« on: February 04, 2011, 04:57:40 PM »
Hi,
    I have written a java script that I want to run automatically at startup using openjdk-7, is this possible in Tinycore?  Thanks,

Calvin

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10253
Re: Run java script automatically at bootup
« Reply #1 on: February 05, 2011, 01:14:38 AM »
Put it in either bootlocal.sh or bootsync.sh just like other items executed on boot. Probably needs full path, like

/path/to/java /path/to/script.class
The only barriers that can stop you are the ones you create yourself.

Offline Bunn1

  • WikiUser
  • *
  • Posts: 3
Re: Run java script automatically at bootup
« Reply #2 on: February 07, 2011, 01:47:30 PM »
I have the same need as the op and I tried what you suggested above, but I keep coming up empty. I tried both the bootlocal.sh and  the bootsync.sh and neither seems to work.

This is what I tried in both  
Code: newbielink:javascript:void(0); [nonactive]
/usr/local/openjdk-7/jre/bin/java -jar /home/tc/myjar.jar &
is there something I am doing wrong, or do you have any other suggestions?
« Last Edit: February 07, 2011, 01:51:08 PM by Bunn1 »

Offline curaga

  • Administrator
  • Hero Member
  • *****
  • Posts: 10253
Re: Run java script automatically at bootup
« Reply #3 on: February 08, 2011, 03:37:55 AM »
Is it a graphical app? Then it should be started from .X.d, not bootlocal.

Otherwise, use it from bootsync.sh without backgrounding, to see if there's any output. Maybe add a long sleep after it, so you have time to read if it exits immediately.
The only barriers that can stop you are the ones you create yourself.

Offline Bunn1

  • WikiUser
  • *
  • Posts: 3
Re: Run java script automatically at bootup
« Reply #4 on: February 08, 2011, 09:42:47 AM »
It is actually supposed to establish a link to a Database (on a remote server) and report the ip address of the client. I can get other things to run using the method you mentioned just not the network connectivity. when I run my script normally, it works perfectly. However, when I run it from startup, I get nothing.
« Last Edit: February 08, 2011, 11:10:44 AM by Bunn1 »

Offline Bunn1

  • WikiUser
  • *
  • Posts: 3
Re: Run java script automatically at bootup
« Reply #5 on: February 08, 2011, 12:25:05 PM »
Ok, your suggestion worked, but I had to change the permissions on the script to allow all and it worked. Thanks for your help