[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: postinst howto q's

Some time around  Mon, 18 May 1998 14:02:32 EDT, 
         "Jaldhar H. Vyas" wrote:
 > I'm preparing a new release of my pppupd package and I want to correct
 > some things which though not harmful are annoying.
 > pppupd ships with a conffile which needs to be customized for each
 > individual installation so I ask some questions in the postinst.  However
 > if a person is upgrading from a previous version of the package, chances
 > are he will have already done the customization.  In this case I don't
 > want to annoy him by asking him (and possibly damage his working
 > configuration) by asking him the questions again.  Right now I check the
 > existence of /etc/pppupd.cf (the conffile) and skip the questions if it
 > doesn't exist.  But this doesn't really work because by the time the
 > configure phase of postinst occurs dpkg has already unpacked the default
 > conffile unless the user has an existing one and answered no when dpkg
 > asked to replace it.  In either case /etc/pppupd.cf will exist. Thus:
 > Q1.  How can I tell if the conffile is the package default or a
 > user-modified version?

Well, you could compare the md5sums, but that's not what you want to do...  In 
your case, it's better not to include the conffile in the package, but instead 
create it in the postinst.  You should probably separate the config-file 
creation part into a separate script that the user can run any time s/he feels 
like.  This is what gpm, sendmail and many others do.  

BTW, modifying conffiles in maintainer scripts is against policy (or packaging 
manual guidelines which should be policy).

 > pppud being a daemon to keep ppp connections alive, is pretty useless
 > unless ppp is correctly configured (not just installed) first.  Currently
 > what I do is to ask the user in the postinst if ppp is correctly configured 
 > first.  I only proceed if he answers yes.  I dislike this because
 > interactive prompting should be kept as minimal as possible.  Thus:
 > Q2: How can I reliably determine if a package has been configured?
 > Again I thought of one possible solution.  Do a dpkg -l ppp and if the
 > second character on the line is i, it means the package has been correctly
 > installed.  Is there a better way than this?

Well, I can't think of a way to see if ppp is truly configured, not just 
successfully installed (this is what you will check for with your method).  
Just making pppupd depend on ppp will make sure that ppp will be installed 
before pppupd is configured.  I think that in this case, you have to assume 
that the user configured ppp already and/or do what you are already do: warn 
the user that the package won't work without ppp being properly configured.

Proudly running Debian Linux! Linux vs. Windows is a no-Win situation....
Igor Grobman           igor@debian.org                 igor@digicron.com 

To UNSUBSCRIBE, email to debian-mentors-request@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

Reply to: