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

Re: [ezjail] flavours pitfall

Michiel Detailleur wrote:
>>> What about /usr/local/share? Should be the correct path for third-party
>>> stuff you add to your freebsd system.
>> You're absolutely correct! I didn't notice yet that there is also a
>> skel/ directory under /usr/local/share. Thanks, that will be a much
>> nicer solution then putting my dot files in the basejail :)
> 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 :)