I know how to use /etc/services but if I change it and the inetd package is later updated via apt-get to a new default one, my changes are gone (happened to me on a apt-get dist-upgrade from Debian Wheezy to Jessie). They are saved in a backup, but I still have to re-integrate my changes or alternartivley miss out on the new defaults from the package manager (by skipping the install of the new default version).Is there a way to have a user-generated system wide extension to /etc/services that gets loaded as well and contains only my changes so that the configuration does not get destroyed with a package update?I'm working on Debian Jessie, if relevant.
is there a system-wide extension to /etc/services that does not get replaced on package updates?
debian;networking;apt;package management;services
/etc/services is a conffile, so if you modify it locally and a new package version is installed with a modified version, dpkg will ask you whether to keep your version or install the new one. Unfortunately, it won't give you an easy way to merge your changes.You can divert the package-provided /etc/services and provide your own.dpkg-divert --add --local --rename --divert /etc/services.debian /etc/servicesIf you want to concatenate your own entries or otherwise transform the Debian file, you can run a hook script when APT finishes its job. Declare the script in /etc/apt/apt.conf.d/local-etc-mergeDPkg::Post-Invoke {cat /etc/services.local /etc/services.debian >/etc/services}Alternatively, you can make /etc/services invoke a command when read (that's overkill unless you modify /etc/services.local very often).