On Tue, Feb 03, 2004 at 10:09:41PM +0200, Oleg Goldshmidt wrote:
> 
> On Tuesday 03 February 2004 11:03, Avrahami David wrote:
> 
> > Hi ,
> > During RPM installation I need to get some parameters from user.
> > I tried to add "read" command in SPEC file ( in %post tag ),
> > but during installation program doesn't wait for user input.
> > What should I do in order to transfer parameters during RPM installation ?
> 
> Interaction with user is not acceptable to RPM by design - it must
> support unattended installs/updates. You have to work around
> it. Things that come to mind:
> 
> * use a wrapper interface such as up2date
> 
> * run the interactive part on first invocation of the program
> 
> * something else, depending on what you are trying to do

If the program includes a daemon and you want to verify that the
administrator has run a configuration script you have added, add to the
daemon's init.d script:

if [ ! -r /etc/$package_name/config_file ]
then
  echo "Package $package_name is not configured. You must run $config_script" >2
  exit 1
fi

or alternatively:

if [ ! -e /etc/$package_name/package_is_configured ]
 ...


Or take a more direct approach:

if [ -e /etc/$package_name/you_must_delete_this_file_to_allow_package_to_run ]
 ...

:-)

-- 
Tzafrir Cohen                       +---------------------------+
http://www.technion.ac.il/~tzafrir/ |vim is a mutt's best friend|
mailto:[EMAIL PROTECTED]       +---------------------------+

=================================================================
To unsubscribe, send mail to [EMAIL PROTECTED] with
the word "unsubscribe" in the message body, e.g., run the command
echo unsubscribe | mail [EMAIL PROTECTED]

Reply via email to