Sample Header Ad - 728x90

the relation of /opt /etc/opt and /var/opt

0 votes
0 answers
1493 views
I am reading the Linux [Filesystem Hierarchy Standard](https://refspecs.linuxfoundation.org/FHS_3.0/fhs-3.0.html) , and I am wondering about the relation of /opt , /etc/opt and /var/opt . I can read in 2 places that static configuration and variable data for an add-on installed under /opt, should go into /etc/opt and /var/opt: > Package files that are variable (change in normal operation) must be installed in /var/opt. See the section on /var/opt for more information. > > Host-specific configuration files must be installed in /etc/opt. See the section on /etc for more information. > > *ref: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html* > Host-specific configuration files for add-on application software packages must be installed within the directory /etc/opt/, where is the name of the subtree in /opt where the static data from that package is stored. > > *ref: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s07.html#etcoptConfigurationFilesForOpt* But there is also the below paragraph which leads to my confusion: > Generally, all data required to support a package on a system must be present within /opt/, including files intended to be copied into /etc/opt/ and /var/opt/ as well as reserved directories in /opt. > > *ref: https://refspecs.linuxfoundation.org/FHS_3.0/fhs/ch03s13.html* It appears that the result of these "rules" is that the config and runtime data should exist twice. And it should be copied from /opt to /{etc,var}/opt. That does not appear practical to me. How am I supposed to handle the conflicting sources of truth and file changes?
Asked by The Fool (195 rep)
Aug 26, 2023, 10:24 AM