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

Re: package config





Manoj Srivastava a écrit :
On Tue, 20 May 2008 08:34:10 +0200, Anthony  <anthony.berger@cea.fr> said: 

  
Hello, everybody I have a little question about ucf (example with a
package which contains a file package_file.conf)
    
  
Can i use de package_file.conf.dpkg-old generate by the ucf utility?
    
        Use it for what?

  
I would like to create a  package to configure my authentification on an ldap server.
All of my Debian Sarge Computer users are authenticated on a nis server or on passwd/group files.
AND i want to configure all of them on my ldap server.

So i need to install package :
libpam_ldap
libnss_ldap
ldap-utils
nss_updatedb
libnss-db

And change configurations :
pam_ldap.conf
libnss_ldap.conf
/etc/ldap/ldap.conf
nsswitch.conf
nss_updatedb cron.hourly



  
I would like to know how can i restore the old conf files after use
ucf.?
    
        If this is in a maintainer script, just don't run ucf. If this
 is as an end user, you should have been asked a question had you
 modified the file -- and yes, you can recover the older version of the
 file.

  
I want to preserve my configuration, so i would like to use ucf (or dpkg-divert)

But maybe i don't understand the necessity of the ucf utility.
If the file is not a conffile, does i need to use it?
But, even if it is not a conffile, a upgrade can override it.?

What i have done :
My package install the files in /usr/share/site_configuration/.
My postinst script use ucf to install them in the right place.

It 's not a good job ?


I have created a package which manage some files with ucf BUT when i
remove the package i would like to restore the files before the
installation .  I could rename the file package_file.conf.dpkg-old in
package_file.conf in postrm script (remove)
    
        The dpkg.old file might not exist at that point ( the user might
 have gotten rid of it, for one thing). If you want to reliably do that,
 copy the file somewhere safe, and restore from your cached location
 later.  Depending on the old file being around is risky.

  
So i could:
save the old configuration files (maybe in /usr/share/site_configuration_backup/.)
My package install the files in /usr/share/site_configuration/.
My postinst script use ucf to install them in the right place.
On postrm or prerm (remove) , restore the backup files.
(and on purge, purge the ucf stuff)


Thank you for your recommendations...


Anthony



        manoj
  

Reply to: