Fw: samba-tool command structure

Giampaolo Lauria lauria at us.ibm.com
Thu Sep 1 12:13:26 MDT 2011

Hi Jelmer,

Once again, thanks for your input.
I agree with you, maybe testparm should be split into two different 
commands. One to validate the config file, the other to extract different 
keyword values from the configuration file.

Regarding the vampire command, I see now why you would want to have it as 
a "machine" subcommand.

Let's see what the rest of the community votes, as long as we can all 
agree on a solution.


From:   Jelmer Vernooij <jelmer at samba.org>
To:     Giampaolo Lauria/Poughkeepsie/IBM at IBMUS
Cc:     samba-technical at samba.org
Date:   09/01/2011 12:32 PM
Subject:        Re: Fw: samba-tool command structure

Hi Giampaolo,

On 26/08/11 19:39, Giampaolo Lauria wrote:
> 2) In general, I think it is easier to find things that are grouped by
> category. It would also be nice to have a single object (diag in our 
> as a single entry for the administrator to validate different
> configuration settings.
> I think testparm belongs to a diag-like command.
> After looking at the "testparm" code in more details, I noticed that it
> does nothing more than validating the values for each keyword in the
> config file. The fact that it allows the user to specify a section or a
> keyword, is just to simply dump that section or keyword after validating
> all the keyword values anyway. Unless I am missing something, I am not
> sure how useful the keyword value(s) dump can be or whether it is a bug 
> the command.
> I am not crazy about the diag naming myself but could not come up with
> anything better for the time being. Please feel free to suggest a better
> name.
I think we should consider more than just regrouping these commands, but 
changing them a bit as well.

testparm currently does two things:

  * it can be used to access (and in the future, perhaps manipulate) the 
configuration file.
  * it runs a few basic checks to see if the configuration file is 

dbcheck checks that the database is consistent and has valid data.

Perhaps we can split it up like this:

  * a subcommand for accessing and manipulating smb.conf, perhaps 
"samba-tool config ..." ?
  * a subcommand for verifying your setup (both database and 
configuration), perhaps "samba-tool check" ?

$ samba-tool config get "netbios name"
$ samba-tool check
Domain name MYDOMAIN in configuration file is not present in database
$ samba-tool check --db-only


What do you think?

> 3) While keytab is a concept that exists outside of Samba, my
> understanding is that the exportkeytab in Samba4 is strictly referring 
> a keytab from an AD domain. I've referenced to this link:
> http://wiki.samba.org/index.php/Keytab_Extraction
> Regarding the vampire command, here is a comment from Andrew Bartlett:
> "'samba-tool domain vampire' is just a special case of 'samba-tool 
> join', using a different codebase.  it should be an option for
> developers (--old-vampire-code or such) not a top level command), as it
> is no longer the preferred code."
> Being only a special case of "join", then maybe it is a domain 
> Otherwise, we would have to move the "join" command as well.
Vampire originally was a way to suck everything out of a remote machine 
in order to be able to replace it. While that is in some ways pretty 
similar to joining a domain, I think it is quite different (you can't 
"join" a standalone machine). I'm not at all familiar with the current 
code though, so perhaps it's not (any longer?) as generic as I was hoping.



More information about the samba-technical mailing list