I am running SUSE 10.2 under z/VM 540 and have java working fine. I also have IBM EKM software running fine(if I execuute the script manually).
I am trying to start this software automatically following the boot process. I have tried creating a member /etc/init.d/after.local but it does not seem to know where java is.
/etc/init.d/after.local: line 2: java: command not found""
After I login to any user I can get java -version to work, so my classpath is good.
LINUXEKM:/ # java -version
java version “1.5.0”
Java™ 2 Runtime Environment, Standard Edition (build pxz64dev-20091106a (SR11 ))
IBM J9 VM (build 2.3, J2RE 1.5.0 IBM J9 2.3 Linux s390x-64 j9vmxz6423-20091104 (JIT enabled)
J9VM - 20091103_45935_BHdSMr
JIT - 20091016_1845_r8
GC - 20091026_AA)
JCL - 20091106
LINUXEKM:/ #
LINUXEKM:/ # cd $java_home
LINUXEKM:/opt/ibm/java2-s390x-50/ibm-java2-s390x-50 #
How is the best way to run this script after we boot up? I don’t want to mess up any paths for java with my after.local script.
If you look at any of the scripts in init.d, you’ll see that the full path is defined for each binary that the scrip executes. The environment is probably not set for after.local, and so the path needs to be defined.
To find the path to your java binary enter at the command line:
I had this same issue. This actually resolved my issue. However, I am curious if there is any way to set up the environment so init recognizes java without the full path being specified.
On 08/21/2012 04:56 PM, cfsavant wrote:
>
> I had this same issue. This actually resolved my issue. However, I am2
> curious if there is any way to set up the environment so init recognizes
> java without the full path being specified.
which Java did you install, and how did you install it? and what
operating system and version are you using??
that is, if you installed openJDK by using YaST or zypper it should have
been as you wish…
On 08/21/2012 09:56 AM, cfsavant wrote:
>
> I had this same issue. This actually resolved my issue. However, I am
> curious if there is any way to set up the environment so init recognizes
> java without the full path being specified.
Because the PATH part of the environment is setup during the log-in process, it
is not there one for the boot scripts. At that point, the process is running
with the privileges of the user with UID of 0, but root is not logged in.
You could experiment with setting PATH, but I do not know if it will work. It is
safer to always include the full path for all commands.
That is exactly what I was looking for. I can take it from there. Also I realized I can just set the env vars in the script itself. I only rely on one that tells me my environment, i.e. dev, uat, prod.