Re: package config

2008-05-21 Thread Anthony



Manoj Srivastava a écrit :
On Tue, 20 May 2008 08:34:10 +0200, Anthony  [EMAIL PROTECTED] 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
  


Re: package config

2008-05-21 Thread Josselin Mouette
Le mercredi 21 mai 2008 à 10:39 +0200, Anthony a écrit :  
 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

 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 ?

It is not possible for a package to change another package’s conffiles,
even by using ucf. The changes would be considered local by the next
upgrade of the package you are modifying the configuration.

The appropriate tool for modifying such configuration is a centralized
administration utility like puppet or cfengine.

Cheers,
-- 
 .''`.
: :' :  We are debian.org. Lower your prices, surrender your code.
`. `'   We will add your hardware and software distinctiveness to
  `-our own. Resistance is futile.


signature.asc
Description: Ceci est une partie de message	numériquement signée


package config

2008-05-20 Thread Anthony

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?

I would like to know how can i restore the old conf files after use ucf.?

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)


Thank you

Anthony


--
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]



Re: package config

2008-05-20 Thread Manoj Srivastava
On Tue, 20 May 2008 08:34:10 +0200, Anthony  [EMAIL PROTECTED] 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 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 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.

manoj
-- 
You have a tendency to feel you are superior to most computers.
Manoj Srivastava [EMAIL PROTECTED] http://www.debian.org/~srivasta/  
1024D/BF24424C print 4966 F272 D093 B493 410B  924B 21BA DABB BF24 424C


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]