2

Linux distributions place some important scripts and config files in the skeleton, from where they are copied to each new user's home directory. Ideally system-wide files would be used instead of anything automatically copied to home but this is not always possible or practical. In particular, shell startup scripts are nearly always placed in skel.

This poses problems when packages are upgraded and any changes that need to be done to those scripts are installed in /etc/skel/ but all existing users retain the old versions in their homes, and often the old version causes serious problems with the changed system software.

Those changes would need to be synced to all existing users in an automated fashion. We don't want to overwrite user's own changes, so a simple cp or rsync won't suffice, and ideally we would have auto merging when possible.

My question is, is there any existing clever solution to such syncing? I can write my own Python script but it would be nice if someone else had already sorted out the problems that might occur.

There is a related question regarding a specific setup, with no solution for general purpose syncing: Adding/updating skeleton files after user creation

Tronic
  • 121
  • 2

2 Answers2

4

I know this probably feels like a non-answer, but my answer is to avoid doing that if at all possible.

The stuff under skel really should only be per-user things, and shouldn't need to be managed after they have been deployed.

If you have shell fragments and config put them in the /etc/profile, /etc/profile.d.

Drop any system wide scripts under /usr/local/bin.

System wide configuration should go under the appropriate file in /etc. Or if the app doesn't support a system wide configuration , maybe add a config file under /etc and deploy a symlink to the /etc config file via the skel.

Zoredache
  • 128,755
  • 40
  • 271
  • 413
  • 1
    I concur absolutely. Unfortunately the distributions didn't get that memo, so they configure things like shell completions via skel and then break those in upgrades. – Tronic Jul 03 '21 at 23:51
0

You should be using centralized management systems like ansible (or any other system you prefer) to distribute scripts instead of relying on standalone methods like /etc/skel. Just my two cents.

Xavy
  • 149
  • 3