Okay, so after reading the thread, I realized interation is not a Good Thing. So my 
approach of
putting a script somewhere is the right thing to do.

But I need something to inform the user. For interactive packages, wrapping the binary 
in a shell
script that checks if the package is configured is an option. But what about daemons? 
Most people
don't check the boot sequence.

Maybe we should go this way:
- RPM installs the package.
- If the package needs configuration, it creates a script named by the package in 
"/etc/pkgcfg".
For example, /etc/pkgcfg/frontpage-%{version}.
- We add a few lines of code in kpackage, gnorpm to check for that file and execute 
the script in
an xterm.
- For initial cdrom installation, we add a few lines in root's profile and in the 
distrib
documentation saying that "Some packages come with configuration scripts. Those can be 
found in
/etc/pkgcfg".
- Eventually, Linuxconf, Lisa, Yast or any such configuration tools could be called by 
those
scripts. For example, if there is a linuxconf module for a package, run the module, 
else start an
xterm.

Jean-Michel Dault
[EMAIL PROTECTED]
[EMAIL PROTECTED]

Axalon Bloodstone wrote:

> Let me clairify, i didn't say to add any interaction, thats totaly
> contrary to the basic concept of rpm. Jean-Michel needs to inform the
> admin that it's not fully setup yet, kpackage gnorpm and others do not
> show the echos from a %post. Lots of packages need to be configured on a
> site by site basis, echoing "Hey add your servers IP to /etc/foo.cfg" in a
> %post is a good way to let the admin know about it without sending them
> diggin thru 2Mb's of text.
>
> On Fri, 27 Aug 1999, Stefan Siegel wrote:
>
> > Axalon Bloodstone wrote:
> > > On Fri, 27 Aug 1999, Jean-Michel Dault wrote:
> > > > Hello,
> > > >
> > > > I have a few packages that would require an interactive post-install
> > > > script. For example, MySQL could ask for the database password to
> > > > create, Frontpage could ask for the name of a virtual host. Some
> > > > packages, like Postgresql, should ask the user if it should create the
> > > > sample database, etc...
> > > >
> > > > I haven't found the perfect way to do it yet. Assuming defaults is very
> > > > dangerous regarding security when it comes to passwords, and we all know
> > > > the PITA we had with Postgresql over-writing a poor user's database when
> > > > upgrading.
> > > >
> > > > Right now, I solve the problem by creating a script (eg:
> > > > /root/install-frontpage.sh) and echoing a message for the user. But with
> > > > gnorpm or kdepackage, you don't see it.
>
> if [ -z $DISPLAY ] ; then
>   echo "Run /root/install-frontpage.sh , To Personlize your Frontpage configuration"
> else
>   if [ -x /usr/X11R6/bin/xmessage ]; then
>   xmessage "Run /root/install-frontpage.sh , To Personlize your Frontpage 
>configuration"
>   else
>     for i in `w|grep root|awk '{print $2}'` ; do
>      echo -e "Run /root/install-frontpage.sh , To Personlize your Frontpage 
>configuration\n" \
>      > /dev/$i ; done
>   fi
> fi
>
> > > > What would be great is a special attribute to the %post section,
> > > > something like "%post --interactive" that could start an xterm or pause
> > > > the execution of rpm while the script asks for the information and
> > > > configures the package.
> > > >
> > > > Maybe there is a better solution. If any of you has an idea,  just let
> > > > me know.
> >
> > Why not set a random password and sent it via mail to root?
> >
> > > I don't much like the idea of interactive posts, but hey i can see the
> > > need here i'm not blind. Why not just check for a $DISPLAY and pop up an
> > > xterm?
> > No no, don't do that please reat the thread
> >
> >   User input on post install script
> >
> > on
> >
> >   http://linuxwww.db.erau.edu/mail_archives/rpm-list/Aug_99/
> >
> > here some important mails:
> >
> >   http://linuxwww.db.erau.edu/mail_archives/rpm-list/Aug_99/0148.html
> >   http://linuxwww.db.erau.edu/mail_archives/rpm-list/Aug_99/0165.html
> >   http://linuxwww.db.erau.edu/mail_archives/rpm-list/Aug_99/0167.html
> >
> >
>
> --
> MandrakeSoft          http://www.mandrakesoft.com/
>                                         --Axalon

Reply via email to