Index: [Article Count Order] [Thread]

Date:  Mon, 3 Mar 2008 18:37:14 +0100
From:  "Tobias Gablunsky" <t.gablunsky (at mark) cbxnet.de>
Subject:  [coba-e:12172] Re: AW:  Provisioning
To:  <coba-e (at mark) bluequartz.org>
Message-Id:  <01E188343A33DE4E8B1A00D7980BC879023A47EC (at mark) s2.combox.de>
X-Mail-Count: 12172

> 
> On Mon March 3 2008 09:18, Tobias Gablunsky wrote:
> > > -----Original Message-----
> > > From: Larry Smith [mailto:lesmith (at mark) ecsis.net]
> > > Sent: Monday, March 03, 2008 2:04 PM
> > > To: coba-e (at mark) bluequartz.org
> > > Subject: [coba-e:12168] Re: AW: Provisioning
> > >
> > > On Mon March 3 2008 05:50, Tobias Gablunsky wrote:
> > > > > Believe the BQ system still uses the /etc/skel structure
> > >
> > > (according to
> > >
> > > > > the programs anyway) so you should be able to create 
> the structure
> > > > > or template of what you want in an user account in
> > > > > /etc/skel/user/<lang>
> > > > > directory and it will "recreate" that for each user you add
> > > > > to the system.
> > > > > (where <lang> is the two letter language abbreviation).
> > > > >
> > > > > --
> > > > > Larry Smith
> > > > > lesmith (at mark) ecsis.net
> > > >
> > > > Thanks for your hint!
> > > >
> > > > This works perfectly for files and folders I put into 
> the /etc/skel
> > > > structure - but not if they are hidden.
> > > >
> > > > As there are hidden files that are copied into a new users
> > >
> > > home (e.g.
> > >
> > > > /etc/skel/.bashrc) it cannot just be the hidden type of the
> > >
> > > file. Any more
> > >
> > > > ideas?
> > >
> > > Appears the "hidden" files are directly referenced
> > > in /usr/sausalito/perl/Base/User.pm, so you may have to
> > > modify that file
> > > to get your hidden files to copy, but reading the 
> program(s), it uses
> > > "cp -r /etc/skel/user/<lang>" to copy the files which 
> should also get
> > > any hidden (leading dot) files.  Check the mode and 
> ownership of any
> >
> > This is right but you are wrong ;)
> >
> > The above syntax is as you said, exactly on my system it is:
> >
> >                     system("/bin/cp -r $user->{skel}/*
> > $user->{homedir}");
> >                     system("/bin/cp /etc/skel/.bash* 
> $user->{homedir}");
> >
> > And on the second line one can see that "cp -r" does not 
> copy the hidden
> > files on the first directory (the problem is the shell-expansion of
> > "<path>/*"). So when I change the second line of the code above to
> >
> >                     system("/bin/cp /etc/skel/.* $user->{homedir}");
> >
> > (I remove the word "bash") then everything works as I want it to.
> >
> > Maybe someone on the list can say if it is of any risk to 
> put this into
> > the original package ("base-user-glue").
> >
> > Because I now have to deal with the files of the original 
> distribution
> > which is exactly what I tried to avoid.
> >
> > > files you have put under /etc/skel.
> >
> > Thanks for your help anyway,
> 
> Tobias,
> 
>   My "command" was not meant to be "exact" but to relay what 
> the system was doing.  In that context, add _your_ hidden files
> under the appropriate directory (/etc/skel/user/<lang>) and the
> cp -r should get them correctly without any modification to the
> system area programs.
> 

But it doesn't!
The command used in /usr/sausalito/perl/Base/User.pm is _exactly_:

   system("/bin/cp -r $user->{skel}/* $user->{homedir}");
   system("/bin/cp /etc/skel/.bash* $user->{homedir}");

The first line doesn't copy hidden files in the first directory
($user->{skel} expands to /etc/skel/user/<lang>) because of the bash
expansion of the "*" operator. It does not match on hidden files in this
directory. This line copies hidden files in Subdirectories. But I need
to copy a ".procmailrc" directly into every new users home.
The second line does match on hidden files, but only on those beginning
with ".bash".
That's the reason why I have to edit the system area programs.

> > Thanks for your help anyway,
> 
> Not sure if I understand the context of the "anyway" in the above
> statement, but I can most certainly stop answering any of your 
> questions if my assistance is not helpful in "anyway".

Don't understand me wrong please.
You helped me very much in understanding the way the system works in
creating a user _but_ I'm afraid I have to change the User.pm above
"anyway". - maybe "nevertheless" would be a better word but I'm afraid I
dont feel that confident in writing in your language

tobias

> 
> -- 
> Larry Smith
> lesmith (at mark) ecsis.net
> 
> 
> 
>