Not sure if this helps but sometimes similar things can happen when running commands from cron. Cron doesn't execute the users environment.
You could try executing your users local profile before running the java command.
# . ./java -version
or even just ./java
Failing that what are the following:
- permissions on java
- value of $PATH for normal user and for NSH user.
Hi Alex, try running it in NSH using nexec, this will give you root access to java folders
nsh%> nexec -i -l -e bash
#> execute java, etc... (as root)
We don't have root access. If I try to nexec I get "this account is currently no available".
I compared $PATH for normal user and NSH user and updated the PATH for NSH user to include everything normal user has.
permissions for java: nsh user has lrwxrwxrwx
the interesting part is: prior to this websphere was installed on this linux server by bladelogic being mapped to the same account (and installation is obviously using java) So somehow it worked. Just does not work for the same account via NSH shell.
lrwxrwxrwx means that it’s a link.
Check the permissions on the target file (ls -l)
-rwxr-xr-x 1 <NSH user> <NSH user group> java
when you map to a user blade doesn't load the full user shell. so i would be sure that via the job or whatever is running the install, you have java in the path, during the job run - eg - put a 'echo $PATH' in your package so you can check.
The install actually works fine. all I'm trying to do is open NSH shell afterwards on the the target server and run a couple of commands like versionInfo.sh to verify websphere installation. Most of the time I don't have access to the server through normal user login process (and no root access) so my interactive access to linux server is limited to NSH shell (everythign is mapped to a single unix account, same account that is used in all installations, jobs)
I have compared the $PATH in "normal" non-nsh session, NSH session, and also saved the $PATH during bladleogic job that installs websphere on the same server (successfully)
I've made sure that I manually set PATH in my interactive NSH session to include all of the enries found in all of the above variants of $PATH.
It does not work. which is very frustrating because I have to request access to the server just to run those couple of commands while all I should need is NSH.
Rather than setting the environment in NSH, why don’t you put all the commands in a small script and kick it off after the install?
I mean, deploy something like:
If you do it this way, it will be run in sh rather than nsh, so you may be able to set your environment and have the post commands run successfully
How are you trying to run the commands in the script? are you nexec’ing the script or the commands?
I'm not runnig any scripts, I'm not installing anything when I'm having this problem - I'm just trying to interactively open NSH promt and execute a couple of commands on a Linux host to manually validate websphere installation.
Same commands that work on the same host in the same user context (and with the same PATH) when connecting "normally" via PUTTY.
In NSH these commands fail. The commands (for example websphere's versionInfo.sh) all use java. They all work in Non-NSH SSH sessions. In NSH I get error indicating it can't find java and if I directly execute java (for example java -version) it says permissions denied even though I do have all permissions.
How are you running whatever you are trying to run? like
Or “nexec –e somefileontarget”
open NSH prompt on the server and run /opt/IBM/Websphere/Appserver/bin/versionInfo.sh
You are cd’ing over to the server and running that directly and not via nexec? Or nsh is installed on the box w/ the script.