4

Ok this may not be a very concrete question, and is perhaps subject to taste, yet I'm struggling to get this right so here it goes.

I have a computer. This computer has linux on it (thank god). Arch Linux to be specific (with awesome wm). I am the single user on this computer.

As to good practice I've set up two users: the root user and the everyday use romeovs user. This way I only use permissions when needed (using sudo for example).

Over the years I have been pimping out my software suite, adding a bunch of applications to this computer. Notably: vim, git, mpc, mutt, calcurse, ufw, ...

Now here is the rub: which of these applications' config files do I use? All of these supply an /etc-based global configuration file, that affects all users, as well as a local ~/.config (or, sadly, ~/) config options.

I've always worked using the local configuration setups, because this felt more natural. But as I grow more familiar with my computer, I feel this somehow lacks elegance. The contra's to this approach are:

  • dicrepancy when switching to root user, even with sudo (e.g. when using vim)

  • will not always work, e.g. when loading deamons from the arch linux DEAMONS array they are run by the root user and thus don't pick up local user configs.

  • major $HOME directory clutter. Sadly there are very few apps that adhere to the $XDG_CONFIG_HOME philosophy.

Benefits are:

  • stuff is local, which feels more in the lines of the permissions splitting between root and romeovs.

  • quick and easy acces to the files. no need to sudo to edit them.

  • easier for git tracking of the config files.

  • somehow feels safer: a user can screw stuff up without messign with the machine's global settings.

  • it is more "a-package-update-may-overwite-my-config"-proof

Let's get conrete:

What is the de-facto standard to split configuration on a single user machine, especially for the system maintainer (single-user)?

romeovs
  • 1,660
  • 5
  • 21
  • 33
  • 1
    Maybe [etckeeper](http://joeyh.name/code/etckeeper/) can help you - it tracks config files in `/etc` using `git` (or `hg`, `darcs`, `bzr´). – fheub Jun 05 '12 at 11:30
  • I've tried that, but I prefer managing it mysefl with git. This is not the main problem though. It is about what is the 'right' thing to do. – romeovs Jun 05 '12 at 11:39

1 Answers1

13

One day you're going to change your computer, or to give someone else (a family member, for example) an account on your computer.

  • If you want to keep a setting on your next computer, put it in your home directory.
  • If the other person might want a different setting, put it in your home directory.
  • If the setting is computer-dependent and not user-dependent, put it in /etc.

Your arguments against putting configuration files in the home directory don't really hold water:

  • sudo keeps the HOME environment variable (unless you've told it not to). So your programs will keep reading their settings from your home directory.
  • Daemons are not supposed to read your personal settings. Daemons are normally configured through files in /etc, not through environment variables or through files in your home directory.
  • $HOME is supposed to have a lot of dot files. That's why ls doesn't show them.
Gilles 'SO- stop being evil'
  • 807,993
  • 194
  • 1,674
  • 2,175
  • I would like to ba able to easily switch to a new computer indeed. I thought putting all in `$HOME` would help me do that, but a recent pc crash has shown otherwise. Surely all my local files were easily put back (git+dropbox) but I had to fiddle a lot with the `/etc` stuff anyways to get everything right. That's why I had the idea to put everything in `/etc` and keep better track of that (again, using `git`). I geuss I'll keep it the way it is, in `$HOME`, although I lament the clutter of the home dir (XDG!!!). – romeovs Jun 05 '12 at 08:39
  • Keeping config files under /home also facilitates (a) reinstalling Linux (if you have /home in a separate partition/volume, which you really should), (b) running multiple distributions and keeping your files available to all. As for `/etc` security, back up your computer regularly and you won't have issues. Dropbox counts if you don't mind the privacy/security considerations (`/etc/shadow` on the internet? The horror) – Alexios Jun 05 '12 at 09:18
  • @romeovs I've been using [etckeeper](http://packages.debian.org/etckeeper) to manage `/etc` since it appeared on the scene. – Gilles 'SO- stop being evil' Jun 05 '12 at 18:30