Operating System - HP-UX
1847073 Members
5007 Online
110262 Solutions
New Discussion

postinstall script problem

 
Jun Zhang_4
Regular Advisor

postinstall script problem

In the postinstall script executed by swinstall, the command
perl Makefile.PL
generated Makefile. The variable PERL is assigned the value "0" in the Makefile, which caused the execution phase of swinstall to fail. The error message in /var/adm/sw/swagent.log is "perl is not found".
If "perl Makefile.PL" is executed manually, the PERL variable in Makefile has a value /opt/perl/bin/perl as expected.
I added
echo $PATH > /tmp/result
ll /opt/perl/bin/perl >> /tmp/result
in the postinstall script before the line
perl Makefile.PL
and run swinstall, the result is fine.
Can somebody help?
Jun
Food lover
2 REPLIES 2
Bhuvaneswari Selvaraj
Valued Contributor

Re: postinstall script problem

Within the sw session our usual PATH variable does not exist or will not work, I am not sure of which one...Many of the sw install scripts will get executed even before the PATH is set. Hence in all our sw scripts(configure, postinstall, preinstall and so on), we are expected to give the full paths. I guess the only path they can recognise is the /sbin.

Just try giving the whole path of perl within the sw script and then try the same.
Elmar P. Kolkman
Honored Contributor

Re: postinstall script problem

Or set your PATH variable in the post install script. When editing the file using vi type:
!!env | grep ^PATH=

It will put your current PATH in the file.
Same works for other variables too, of course.
Every problem has at least one solution. Only some solutions are harder to find.