Solaris Packg Translation Problem

Why is that I am not able to perform i/o thro a exe file,during the post-install script for SOLARIS pkgtrans ,
routine. It just prints out the prompts with out waiting for the user inputs !
Who is Participating?
wjgConnect With a Mentor Commented:
Have you stated your problem correctly? pkg*trans* is not interactive and does have no postinstall. Do you mean pkg*add*?

If you do: All package procedures, except request, are designed
to be non-interactive! See Solaris package documentation in the

Solaris (as opposed to other SV pkg mechanisms) enforces this by redirecting stdin from /dev/null. This explains the behaviour of your programs (or a shell read): Reading EOF the read(s) return right away with nothing read.

[[ The design rationale is that this way the request script can
be run independently of package installation and the answers
produced (or even answers generated by some other mechanism) can than be used to perform non-interactive package installation -
which is really a bonus is you have to do installations on a bulk
of machines. ]]

The only official way to get user input is to negotiate it in the
request script (e.g.: echo "Huh> \c"; read VARIABLE),
store it in the package environment (:= put lines of the form
echo "VARIABLE=\"variable value\" >>$1
in request) and then use the variable values in the postinstall
procedure (e.g. echo "$VARIABLE" | your_program).

You could also write a program that stores larger amounts of
data in a file in /tmp and then pass the filename to postinstall
through a package variable , as described above.

Hope that solves your problem.
karpaAuthor Commented:
The way to get around this problem is more important and the author has not given in a laymans terms,otherwise its good
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.