2

hi i want to run my java program as daemon service as i have a jar file for that program does any one has general daemon script that runs at boot and can be start stop and restart so please share it with me in which i will simply change the path of jar with my jar file and i would use it

i have search for it a lot i have found 2 to 3 script but they have some error so i cant use them i will mention there link also,

http://www.source-code.biz/snippets/java/7.htm

http://www.apexninjas.com/blog/f?p=100:1:0::::P1_ARTICLE:1460

http://zerocool.is-a-geek.net/?p=139

the last link is not giving any error but it is not running service too as i check it using command "service vsftpdg status" so there is no service found error in that last link i use code and just change the path for my jar file and it would be like this,

nohup java -jar /usr/local/vsftpdg/helloworld.jar /usr/local/vsftpdg 2>> /dev/null >> /dev/null &
    echo $! > /usr/local/vsftpdg/pid

and the path changes the same as it need in the further code i mentioned the way i change the file path as above after a serarching for more then a week i am asking for general script that would run my jar file

Hopes for your help thanks in advance

Syed Raza
  • 61
  • 2
  • 2
  • 6
  • Overlap? See: http://stackoverflow.com/questions/8998543/run-java-program-as-daemon-service-following-guide-not-working-rhel-5 – Joachim Isaksson Jan 27 '12 at 09:46
  • possible duplicate of [Best Method to run a Java Application as a *nix Daemon or Windows Service?](http://stackoverflow.com/questions/25530/best-method-to-run-a-java-application-as-a-nix-daemon-or-windows-service) – skaffman Jan 27 '12 at 09:49
  • @Joachim Isaksson it is not duplicate there is some other link use in it and the problem is also some thing different – Syed Raza Jan 27 '12 at 09:55
  • @ skaffman but there isn't any example script in that post – Syed Raza Jan 27 '12 at 09:56
  • @SyedRaza That's why I didn't call it a duplicate, just an overlap. Thought the pointer may be useful. – Joachim Isaksson Jan 27 '12 at 09:57
  • @All i have successfully complete my task with the help of you people APEXNINJA link help me out you have configure it according to your need ... . :) – Syed Raza Feb 01 '12 at 04:20

0 Answers0