Ubuntu – The purpose of /etc/default


I've assumed /etc/default was a handy place to save the post-install/default state of configuration files so that when some poor sysadmin arrives at a new system she can quickly determine what has been customised on that instance.

But having just had a look around in there it seems I am mistaken? So apologies if this is a dumb question…

  1. What's supposed to be in the /etc/default directory?
  2. Where would it be appropriate, or is there a convention, for saving the default state of config files?

Best Answer

  • From a post on a Slackware forum:

    Basically, /etc/default contains some parameters that the end user or administrator is likely to change, rather than embedding the values in the actual boot scripts. In this way, changes will persist even if you upgrade the package and the boot script is replaced.

    In Debian, /etc/default/ is a directory of mostly empty files. The way it is meant to work is that each /etc/init.d/test script first sources /etc/default/test before starting/stopping the test service. The purpose of the file is to provide extra options for starting the service, or override certain aspects of the service's startup.