Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

From a developer's perspective. Should I use a text-based config in /etc or in $HOME? Or something else?

share|improve this question
    
I lack the expertise to know whether they would be preferred or not, but GConf and dconf are other ways to store application settings. –  Firefeather May 13 '11 at 21:17
1  
Thanks for the suggestion. Personally, I prefer plain files because I have nightmares about the registry of windows. In my opinion the ideal way of storing settings is plain text files, preferably with a standard format (INI, JSON, XML, YAML etc.). A single database (especially dconf which is monolithic) is a single point of failure. –  Tamás Szelei May 14 '11 at 13:20
    
ás: Thanks for sharing: I learned some new things from your comment that will come in handy if I ever get around to writing some software of my own! –  Firefeather May 17 '11 at 18:33
    
I'm glad it helps you :) –  Tamás Szelei May 17 '11 at 18:56
    
Related : askubuntu.com/questions/59822/… –  Tachyons Oct 5 '12 at 14:59

1 Answer 1

up vote 9 down vote accepted

If you are talking about a system wide daemon, a file in /etc is appropriate. If you are talking about an application that should have per-user settings, the home directory is appropriate. For new apps, it would be a good idea to follow the XDG Base Directory specification:

http://standards.freedesktop.org/basedir-spec/basedir-spec-latest.html

This basically states that you should store your config files in $XDG_CONFIG_HOME, which defaults to ~/.config

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.