From Fedora Project Wiki
(Created page with "= Empty /etc and /var = == Summary == To ease the provisioning of OS and container images, the goal is to be able to start the system with an empty /etc and /var. rpm packag...")
 
No edit summary
Line 95: Line 95:
<!-- * Blocks release? N/A (not a System Wide Change), Yes/No
<!-- * Blocks release? N/A (not a System Wide Change), Yes/No
-->
-->
<!--
== Documentation ==
== Documentation ==


<!--
 
== Release Notes == -->
== Release Notes == -->
<!-- The Fedora Release Notes inform end-users about what is new in the release.  Examples of past release notes are here: http://docs.fedoraproject.org/release-notes/ -->
<!-- The Fedora Release Notes inform end-users about what is new in the release.  Examples of past release notes are here: http://docs.fedoraproject.org/release-notes/ -->

Revision as of 08:03, 7 May 2014

Empty /etc and /var

Summary

To ease the provisioning of OS and container images, the goal is to be able to start the system with an empty /etc and /var. rpm packages should/must not ship any files in /etc and /var.

Detailed Description

/etc

Starting with udev, systemd, kmod (modprobe), and dracut, tools read their configuration data from different places, where files with the same name overwrite files from previous directories. These directories mostly follow the naming convention:

  • /usr/lib/<packagename>/
  • /run/<packagename>/
  • /etc/<packagename>/

The application ships with files in /usr/lib/<packagename>/. Dynamic runtime configuration is done via /run/<packagename>, which ensures, that these files don't persist over a reboot. The administrator can customize the behavior in /etc/<packagename>, overwriting any defaults. It is encouraged to compile in sane default values, so that /usr/lib/<packagename>/ is normally not needed.

This model ensures that with an empty /etc the OS starts with sane default values.

/var

To populate contents in an empty /var:

  • use systemd-tmpfiles ( see tmpfiles.d(5) ) to create the necessary directories with the correct permissions and owner
  • copy over default files from /usr/lib/<packagename>/ to /var, if the directory is empty