0

I currently have an Ubuntu 18.04 server with php-fpm installed. In the spirit of maintainability, instead of editing /etc/php/{version}/fpm/pool.d/www.conf I copied it and renamed it as {domain}.conf for two reasons:
1) I might have more sites and thereby more pools;
2) when I run apt upgrade I don't want to have to merge in changes from the package.

To avoid the default www.conf being loaded when starting the php-fpm service due to collisions with the site pool, I renamed it to www.conf.dpkg so that it is not loaded. But each time I upgrade the php-fpm package, apt asks me to choose what to do:

Configuration file '/etc/php/{version}/fpm/pool.d/www.conf'
 ==> Deleted (by you or by a script) since installation.
 ==> Package distributor has shipped an updated version.

How can I make sure this doesn't happen, or at least the changes get automatically funneled in the renamed file?

mcdado
  • 101
  • 4
  • 1
    Does this answer your question? https://stackoverflow.com/questions/33370297/apt-get-update-non-interactive – Gerald Schneider May 20 '20 at 09:32
  • Not really. I don’t want to accept the changes automatically, because it will lead to the php-fpm service breaking since another pool is set up on the same socket. Even if change the listener path, the default www.conf would still be enabled and use resources for nothing. – mcdado May 20 '20 at 09:36
  • 1
    The accepted answer does not modify your configuration during updates. [`--force-confold: do not modify the current configuration file, the new version is installed with a .dpkg-dist suffix.`](https://raphaelhertzog.com/2010/09/21/debian-conffile-configuration-file-managed-by-dpkg/) – Gerald Schneider May 20 '20 at 09:38
  • Thanks, that’s exactly what I wanted. Can I enable it just for that package? – mcdado May 20 '20 at 09:39
  • 1
    Does this answer your question? [Automatically keep current version of config files when apt-get install](https://serverfault.com/questions/259226/automatically-keep-current-version-of-config-files-when-apt-get-install) – Gerald Schneider May 20 '20 at 09:40
  • Do I have to install a package with those options to be able to run `apt dist-upgrade` and automatically get that behavior? Otherwise the way that I understand it is that I have to manually specify those options with the `–o` flag each time I upgrade my system. – mcdado May 20 '20 at 10:45
  • 1
    I don't know if you can set this in a per package basis. The blog post linked in the linked answer shows how to add this to the apt config, so you don't have to specify it during manual updates. – Gerald Schneider May 20 '20 at 11:26

0 Answers0