Tiny Core Linux

General TC => General TC Talk => Topic started by: calvino on February 04, 2011, 04:57:40 PM

Title: Run java script automatically at bootup
Post by: calvino 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
Title: Re: Run java script automatically at bootup
Post by: curaga 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
Title: Re: Run java script automatically at bootup
Post by: Bunn1 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: [Select]
/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?
Title: Re: Run java script automatically at bootup
Post by: curaga 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.
Title: Re: Run java script automatically at bootup
Post by: Bunn1 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.
Title: Re: Run java script automatically at bootup
Post by: Bunn1 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