[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Spam? ] Re: [ezjail] flavours pitfall

Getting OT here, but putting stuff in /usr/local/share/skel (or
/etc/skel) doens't work. adduser and pw only look at /usr/share/skel for
dot files. You can tell them to look elsewhere, but then it won't take
the files from /usr/share/skel anymore... (unless you copy them over to
your new skel directory). Bit stupid IMHO, you'd expect adduser to use
/usr/share/skel and then APPEND the files from /usr/local/share/skel...
Ooh well, I guess I'll copy them all over to /usr/local/share/skel and
then check for updates manually after each base system update.
Not sure this will work ;-) but how about:

- setting an alternate skel directory in the adduser.conf and pw.conf
  in the jail flavour. See manual pages for those files - basically you
  create the defaults and edit.

  adduser -C  [answer interactively]
  sed s:usr/share/skel:etc/skel:g /etc/adduser.conf > \

  (or edit and mv /etc/adduser.conf to /usr/jails/flavours/whatever/etc/)

  pw useradd -D -C pw.conf.tmp
  sed s:usr/share/skel:etc/skel:g  pw.conf.tmp > \

- add cool stuff to the flavour's /etc/skel
  cp dot.cool dot.blah /usr/jails/flavours/whatever/etc/skel/

- symlink /usr/share/skel/* to ../flavour/whatever/etc/skel/ ...

Those links will then refer to the basejail's files when you are in the
jail so when you update the basejail the jail's /etc/skel/ versions will
point to the new versions of the files. You'll miss any files added to
/usr/share/skel of course but it's still sort of more automatic. NB: I
didn't test the above thoroughly it but it should work.

Please test and report back :)
Well, it just so happened that I figured this out yesterday by myself :) I didn't create the pw.conf (figured I'll always use adduser...) and used /usr/local/share/skel instead of /etc/skel, but apart from that, it's all the same.

(By the way, you can add all the symlinks to the current directory all at once with 'ln -s /usr/share/skel/* ./' )

I've done some small scale testing, and it all seems to work here.

Thank you guys for all the help!