user2136963
user2136963

Reputation: 2606

How to specify default conffile?

My package looks this way

package_name
--src
--conf
----default_configuration
--debian
----conffiles

I want to put default_configuration to /etc/logrotate.d/ and ask a user if he wants to overwrite it when he uses dpkg

When I write ../conf/default_configuration /etc/logrotate.d/ to conffiles, dpkg treats it like a single file and creates a message, that it does not exist.

Can I do it?

Upvotes: 0

Views: 140

Answers (1)

Jonathan Hall
Jonathan Hall

Reputation: 79614

conffiles is used to to describe files on the installed system which should be treated as config files. See here. As ../conf/default_configuration doesn't exist once the package is installed, obviously it will say that it doesn't exist.

You're also creating an invalid conffiles file. The spec (see link above) says one file name per line. This is why it treats it all as a single file name.

Further, everything in /etc is automatically treated as a config file, so you have no reason to use conffiles in your package at all. Simply install the file to /etc/logrotate.d (or anywhere else in /etc, and dpkg will treat it properly for you.

If your package isn't already installing the config file, you may want to add this to debian/install:

conf/default_configuration etc/logrotate.d

Upvotes: 2

Related Questions