WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: startup script  (Read 3291 times)

Offline chilly

  • Newbie
  • *
  • Posts: 4
startup script
« on: January 09, 2014, 09:49:05 AM »
Hi all,

i am a noobe and using TC for past 3 days.

I have an issue in setting up the start-up script. I need to run a script that contains "java -jar ..etc". (I have JRE installed and can run the script manually)

I tried to link the script to start-up in 2 ways,

1. I added the call to script in /opt/bootlocal.sh
        ./home/tc/app/myscript
but this gives an error stating JAVA not found. so i thought this script is initialized even before java loaded

2.  Adding a flag file  /usr/local/tce.installed/myscript

content of myscript:

#/bin/sh
./home/tc/app/myscript

but i dont know why, the second one also fails without any log. could some one help me in fixing my start-up scripts.

Thanks

Offline bmarkus

  • Administrator
  • Hero Member
  • *****
  • Posts: 7183
    • My Community Forum
Re: startup script
« Reply #1 on: January 09, 2014, 09:51:46 AM »
Try to remove the leading . in ./home/...
Béla
Ham Radio callsign: HA5DI

"Amateur Radio: The First Technology-Based Social Network."

Offline malikawan

  • Full Member
  • ***
  • Posts: 243
Re: startup script
« Reply #2 on: January 09, 2014, 09:59:50 AM »
first u add java path to ur run java then ur jar file path
e.g
u install java in home/tc and ur jar file is in tc folder then

/home/tc/jdk1.7.0_07/bin/java -jar /home/tc/filename.jar

plz change the jdk1.0.0_07 to which version u installed
copy this line amend the path and filename and save as filename.sh
then give this file to execute permission and place at home/tc/.X.D
its start on boot every time.
Please give me feed back its work or not


Malik Awan

« Last Edit: January 09, 2014, 10:03:05 AM by malikawan »

Offline chilly

  • Newbie
  • *
  • Posts: 4
Re: startup script
« Reply #3 on: January 10, 2014, 05:13:45 AM »
Thanks Markus and Malik.

@Markus : i tried removing leading '.' but it remains the same. it didnt fixed my issue

@Malik : your soln works. but still  I prefer the script to run once all scripts have been executed, rather than exporting the java path..as it will set by the scripts that will be executed later

Offline malikawan

  • Full Member
  • ***
  • Posts: 243
Re: startup script
« Reply #4 on: January 10, 2014, 05:45:39 AM »
Thanks Markus and Malik.

@Markus : i tried removing leading '.' but it remains the same. it didnt fixed my issue

@Malik : your soln works. but still  I prefer the script to run once all scripts have been executed, rather than exporting the java path..as it will set by the scripts that will be executed later

ok chilly link ""than copy this line to /home/tc/.profile open with editor
then at the end after fi and before /etc/sysconfig/Xserver paste this line


PATH=$PATH:/home/tc/jdk1.0.0_07/bin/
export PATH


plz give me feed back
« Last Edit: January 10, 2014, 05:48:18 AM by malikawan »

Offline chilly

  • Newbie
  • *
  • Posts: 4
Re: startup script
« Reply #5 on: January 15, 2014, 11:46:52 AM »
will try and will let you know