Package post-install script problem


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Package post-install script problem
# 1  
Old 08-08-2008
Question Package post-install script problem

I wrote a post-install script, which is executed after the package installation by command like " pkgadd -d /mypackage.pkg".

I also want to read user input in post-install script as follows:
Code:
  while [ "$ANSWER" != "y" -a "$ANSWER" != "n" ] ;
  do
     echo "Apply changes to database? [y/n]:"
     read ANSWER
  done

However, it does NOT pause and wait for user input at all! Instead, it goes into an infinite loop:
Code:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
Apply changes to database? [y/n]:
...

Any advice will be appreciated!
# 2  
Old 08-08-2008
By the way, if I run the script separately, everything is fine!
# 3  
Old 08-08-2008
I'm not familiar with pkgadd but it looks like it's running the script with input redirected from /dev/null. The recommendation for package installation scripts is to avoid user interaction, anyway. I'd suggest you avoid this dialog altogether; if it's absolutely necessary, I'm imagining the pkgadd documentation will have suggestions for how to properly engage the administrator in a dialogue (probably even before this script runs).
# 4  
Old 08-10-2008
Thanks era.

I went through pkgadd and pkgmk documentation and got no answer for this, unfortunately!

After disucssion with my colleague, we came up with an idea - read the user input from a jar then return to shell script.

It works!
# 5  
Old 08-11-2008
My mistake! It still doesn't work!

According to Solaris packaging documentation, the only place, which the installer can solicit user input, is through "request script". That's a stage far before post-install.
# 6  
Old 08-11-2008
Yes, you just need to pass the result to the post-install script somehow.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Red Hat

faceing problem when i try to install any package!

Hello, When i try to install any package,the following appears: # yum install yum Loaded plugins: refresh-packagekit, rhnplugin This system is not registered with RHN. RHN support will be disabled. Setting up Install Process Nothing to do # plz guide me asap! ---------- Post... (1 Reply)
Discussion started by: ahmedamer12
1 Replies

2. Emergency UNIX and Linux Support

Problem when trying to remove a package using rpm command - error: package is not installed

Hello, i have installed a package by using the command sudo rpm -i filepackage.rpm package filepackage is already installed when i try to remove it, i get an error saying "is not installed": sudo rpm -e filepackage.rpm error: package filepackage is not installed How can... (4 Replies)
Discussion started by: g_p
4 Replies

3. UNIX for Dummies Questions & Answers

Can't install rpm package with --prefix in new path.Error: package is not relocatable

Hello, i have downloaded an rpm package "hadoop-0.20.205.0-1.amd64.rpm" in /usr/local/ directory. I'm trying to install the rpm package in a new path/location (/usr/local/hadoop-0.20.205), but i can't. I did: 1st try: Didn't work sudo rpm -i --prefix=/usr/local/hadoop-0.20.205... (1 Reply)
Discussion started by: g_p
1 Replies

4. Linux

How install a new package without remove old package?

Dear all, I would like to install a new version of package without remove old version on Centos and vice versa. Please give me advice! thanks much, (2 Replies)
Discussion started by: all4cfa
2 Replies

5. Solaris

how to install this package

Dears, i am new user in solaris i am using solaris 10 https://cds.sun.com/is-bin/INTERSHOP.enfinity/WFS/CDS-CDS_SMI-Site/en_US/-/USD/ViewProductDetail-Start?ProductRef=Sol-audio-drivers1.0-x86-G-F@CDS-CDS_SMI after i unzip this package i didn't found any package to install cos i only... (1 Reply)
Discussion started by: sharkux
1 Replies

6. Solaris

not able to install the package

I am working with sun solaris 9 and I want to install some packages but due to less disk space I am not able to install the packages. I am giving the output of filesystem-- # df -k Filesystem kbytes used avail capacity Mounted on /dev/dsk/c0t0d0s0 2148263 1997593 107705 ... (10 Replies)
Discussion started by: smartgupta
10 Replies

7. UNIX and Linux Applications

looking for ImageMagick install package

i am struggling to find an error free, and complete install package for ImageMagick (with perl- "PerlMagick"). imagemagick.org not much help.... links for source, mirrors etc dont work. any pointers appreciated. linux server. (2 Replies)
Discussion started by: mickeymouse
2 Replies

8. Solaris

install and uninstall package

I'm a newcomer for Solaris. I tried to install Net::FTP package ( a tool perl ) on our sun server 5.9. We used the below command: /usr/bin/perl MakeFilePL make make install How can I uninstall this package ? (1 Reply)
Discussion started by: anhtt
1 Replies

9. Solaris

how to install package

Hi How to install package from Freeware for Solaris Specificaly i want to install lsof-4.77-sol10-sparc-local.gz Thanks Amit (2 Replies)
Discussion started by: amitarcade
2 Replies

10. UNIX for Dummies Questions & Answers

uninstall and install a package

Hi, on Red Hat Enterprise Linux AS release 3 (Taroon). How can I : 1-install a package (exemple : compat-gcc-7.3-2.96.128.src.rpm) 2-uninstall (or delete or deinstall) a package (exemple : compat-gcc-7.3-2.96.122). Many thanks before. (6 Replies)
Discussion started by: big123456
6 Replies
Login or Register to Ask a Question