package config - Debian

This is a discussion on package config - Debian ; 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 ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: package config

  1. package config

    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 debian-devel-REQUEST@lists.debian.org
    with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org

  2. Re: package config



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



  3. Re: package config

    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.

    -----BEGIN PGP SIGNATURE-----
    Version: GnuPG v1.4.6 (GNU/Linux)

    iD8DBQBIM/gMrSla4ddfhTMRAp7qAKCtBtHZuFg/iNhnVT4H9u2+oETPywCeO204
    u8udtzzinIekdUeL8K9lcbg=
    =JOBP
    -----END PGP SIGNATURE-----


+ Reply to Thread