Help answer threads with 0 replies.
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!


  Search this Thread
Old 01-31-2012, 01:13 AM   #1
LQ Newbie
Registered: Jan 2012
Posts: 1

Rep: Reputation: Disabled
Question How To Use Java Program(.jar) As Start Up Service RHEL 5 Giving Error ??

hi i have created my jar file PingConsolApps.jar and i have run this jar file at terminal running fine now o want to add it as a service that would start up on boot so i have put my jar file in "/home" place and i have created file PingConsolApps in etc/init.d as following this site,

but i have edited it here,

#! /bin/sh 

case "$1" in 
            cd /home/ 
            /usr/bin/java -jar PingConsolApps.jar & 
            killall -v java 
exit 0 
i gave permission to it ,

chmod +x /etc/init.d/PingConsolApps
and after it i execute,

chmod 777 /etc/init.d/PingConsolApps
i try to start its service

/etc/init.d/PingConsolApps start
it does not show any error but after it i check it using

service PingConsolApps status
it does not show any thing and do not give ant error i check it in running service,

service --status -all
i do not get it there also

when i try to stop it

/etc/init.d/PingConsolApps stop
it give error "java: no process killed"

if it run this service then my sql data base would be updates while it do not up date ???

what are the mistakes in this script help me out to get my goals i am new to linux and development to specially like creating this services

Thanks in Advance
Old 01-31-2012, 05:48 AM   #2
John VV
LQ Muse
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,225

Rep: Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520Reputation: 2520
you are missing a VERY important folder
from your post you DO NOT have a normal user account made
there is no ~/ home folder


also never,NEVER , NEVER run chmod 777 on anything in /bin or /etc , /share ,... NEVER
SElinux will through a temper tantrum . i am betting that "SELinuxTroubleShooter" is giving a warning
chmod 777 /etc/init.d/PingConsolApps
is not good

it also needs to be owned by root and NOT executable by EVERYONE in the world

if the file permissions for a system file are off( not set right) a reboot will not boot SE will stop it

Seeing as red hat ( RHEL) is not a free operating system .
Have you searched the red hat knowledge base ?
you will have to login to red hat site using the username you set up when you bought the REQUIRED subscription

also you might want to read the red hat 5 documentation

Last edited by John VV; 01-31-2012 at 05:56 AM.
1 members found this post helpful.


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to write a daemon Linux service to a Java application which execute a .jar haseit Linux - Newbie 2 10-14-2011 04:10 AM
Java Jar Started via Service cant exec commands on the OS ehask71 Linux - Server 0 08-17-2011 09:03 PM
I got error with this command 'java -jar NodeView-v1.1.jar' mohdismiaswaly Linux - Software 3 04-23-2009 07:24 AM
How to run JAR from within Java program ?! EAD Programming 1 12-31-2006 08:11 PM
How jar java program? treotan Programming 3 09-08-2005 01:03 AM > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:57 AM.

Main Menu
Write for LQ is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration