$PATH is null on client pre and post-exec script (54 Views)
Reply
Regular Advisor
Joseph P. Smith
Posts: 98
Registered: ‎10-28-2003
Message 1 of 5 (54 Views)

$PATH is null on client pre and post-exec script

Good afternoon,

Basic info:
Manager:
DP v6.11
HP-UX nodeA B.11.31

Client:
HP-UX nodeB B.11.31 U ia64
HP Data Protector A.06.11
No patches loaded

Cell mgr nodeA starts backup to nodeB and executes option on nodeB /opt/omni/lbin/begin script that shuts down apps.

When DP calls either a similar option file on the local cell mgr, or when I execute an interactive app shutdown on the remote node there are no errors as both have $PATH defined from /etc/PATH.

However, when DP calls the remote node's /opt/omni/lbin/app-shutdown, it fails to find scripts, commands; even "standard" commands such as grep fail.

I've determined that via "echo $PATH" that $PATH is null in the latter case.

Are there any suggestions to source in DP option pre-exec the remote system's /etc/PATH, or to provide the usual $PATH available via interactive login?

Thanks for your help. ,,, Joe S.
Please use plain text.
Frequent Advisor
Pankaj K gupta
Posts: 56
Registered: ‎01-19-2011
Message 2 of 5 (54 Views)

Re: $PATH is null on client pre and post-exec script

I think there is some mistake in your script please run manually this script to check proper shutdown of application then proper appication UP as well as permission of the user (DP) has the full right as a admin for client .
Please use plain text.
Regular Advisor
Joseph P. Smith
Posts: 98
Registered: ‎10-28-2003
Message 3 of 5 (54 Views)

Re: $PATH is null on client pre and post-exec script

Good Morning,

Thanks for your attention & question.

Perms are O.K. and script executes successfully from terminal interactive session when $PATH is "normal". Also, this only occurs when executed on the remote "client" system, not the cell manager.

Here's "proof" that $PATH is undefined when called from DP on the client(remote) system.

#! /usr/bin/ksh -xv
echo $PATH
+ echo
[NO $PATH VARIABLE DEFINED IN DP]

Thanks.
Joe S.
Please use plain text.
Regular Advisor
Joseph P. Smith
Posts: 98
Registered: ‎10-28-2003
Message 4 of 5 (54 Views)

Re: $PATH is null on client pre and post-exec script

In case anyone else looks around for an answer, here's one provided by an HP consultant we had on hand. I was only smart enough to do what he said!

Source both the system default and root's .profile in the application's shutdown & startup script to establish the normal PATH so that application shutdown finds its commands, scripts, etc.

. /etc/profile 1>&- 2>&-
. ~/.profile 1>&- 2>&-
export PATH

/etc/profile establishes system PATH, and .profile any local modifications.
Please use plain text.
Regular Advisor
Joseph P. Smith
Posts: 98
Registered: ‎10-28-2003
Message 5 of 5 (54 Views)

Re: $PATH is null on client pre and post-exec script

See above
Please use plain text.
The opinions expressed above are the personal opinions of the authors, not of HP. By using this site, you accept the Terms of Use and Rules of Participation