* nix configuration file configuration convention?

May be a candidate for SuperUser, but I thought I would try here first, because the question arose because of a programming project.

Is there a * nix agreement (targeting Solaris, Linux, and OS X) where the configuration information on the system (updated by all users) should be stored by the application?

+5
source share
3 answers

Well, the most common scheme is to have a system-wide configuration in /etc/app_name, and a user can create ~/.app_nameone that overrides the settings in /etc/app_name. You can take another step forward and do it with the help of a three-layer concept: for example, if your application is in /opt/app_name, then you get the default configuration /opt/app_name/conf, and both /etc/app_nameand ~/.app_namecan override it.

IIRC, KDE uses this three-level concept and even has the ability to mark partitions or keys as non-overlapping, so sys-admin can prevent the user from overriding e. d. position of the taskbar. It is probably unnecessary to realize, but perhaps food for thought.

Regardless of whether the configuration is stored in a directory containing several files, or just one file, it does not matter.

+2

, /etc/<app name>, , ~/.<app name>.

+4

The Solaris Standard (SVR4) is designed for application binaries (files that do not change) to fall under / opt / appname, files with different sizes (like logs) to go under / var / opt / appname and the system to access to the files / etc / opt / appname. Customization traditionally goes to / under ~ / .appname.

+1
source

All Articles