More advanced home directory creation in Debian?
I got this idea from Debian Edu, where we need to run scripts when a
user is created to create files adjusted for each user, and we would
like this to work with any tool used to create users.
At the moment, a users home directory is created by adduser and other
tools by copying the content of /etc/skel to the freshly created home
directory, and the ownership of the files are set to the created user.
Some tools will run some scripts after /etc/skel/ is created, but the
location of these scripts differ from system to system. This of cause
causes the created users home directories to have different content
depending on how they are created.
Typical use cases are setting up mail client to use the correct mail
server and other connection defaults and adding KDE and Gnome
shortcuts to the network home directory for a user.
It would be nice if all the tools copying /etc/skel/ also had a common
location for their "post-creating" scripts, making sure users created
by for example adduser, lwat, libpam-mkhomedir and libpam-mklocaluser
get the same content.
The location could for example be /etc/skel.d/, and the scripts should
be called with the path to the new home directory, the name of the
user, and uid and gid of the user, and perhaps some more information
that is needed. This information could either be arguments, or stored
in the environment.
Are there better ways to do this?
If this is a good idea, I suggest we extend adduser in Debian to use
it first, and then move on to change other packages to use this
location too. I suspect it is best to create a new tool for creating
the home directory, to make sure all user creation tools call these .d
scripts the same way.