[Samba] several domain

azzouz azzouz at hymedia.univ-paris8.fr
Fri Sep 4 02:56:02 MDT 2009


Michael Wood wrote:
> 2009/9/3 azzouz <azzouz at hymedia.univ-paris8.fr>:
>   
>> Michael Wood wrote:
>>     
>>> 2009/9/3 azzouz <azzouz at hymedia.univ-paris8.fr>:
>>>       
> [...]
>   
>>>> i write instead :
>>>>
>>>> test -x `/usr/sbin/nmbd -D -s $CONFIG_FILE` -a -x `/usr/sbin/smbd -D -s
>>>> $CONFIG_FILE` || exit 0
>>>>         
>>> This will run nmbd and will probably complain about "test: too many
>>> arguments" (same for smbd) because you're supposed to call "test -x"
>>> with a filename, and not with the string "smbd version ... Copyright
>>>       
>> in fact it work fine. No complain from smbd
>>     
>
> I'm glad you have it working, but that line is wrong anyway :)
>
> "test -x /usr/sbin/smbd" means:
> Is the file called /usr/sbin/smbd executable?  It does not run
> /usr/sbin/smbd.  It just looks at the file to see if it is executable.
>
> "test -x `/usr/sbin/smbd -D -s $CONFIG_FILE`" means:
> Run /usr/sbin/smbd with parameters -D -s $CONFIG_FILE and get the
> output.  (The output could be something like "smbd version
> 3.4.0-GIT-a3e9b62-devel started.
> Copyright Andrew Tridgell and the Samba Team 1992-2009" or it could be nothing.)
>
> If the output was "smbd version..." then the test line will expand to:
>
> test -x smbd version...
>
> and you will get an error about "too many arguments".
>
> If the output was blank, then the test line will expand to:
>
> test -x
>
> I'm not sure why, but that does not complain and also returns
> "success", so in your case I suspect this is what's happening.
>
> But despite "test" not complaining or failing, that line still starts
> smbd and nmbd when it isn't supposed to!  They are supposed to be
> started further down in the script.  That line is only to see if they
> are executable.
>
> I hope my explanation is clear.
>
>   
Hi !

oups ! You are right.

i test it and effectively smbd and nmbd are executed.
I change the script like first.

Thanks for the explanation.

otherwise the script don't work as i expected. i have tow different 
script : one execute 1 instance for the domainn Domain1 and an other one 
for the domain  domain1. The tow script refer to tow different smb.conf 
file.

1 - When i execute the first one first: it 's OK
    But when i execute the second one after: nothing! the process are 
not executed.

2 - When i execute the second one first: it's ok
    But when i execute the first one after: nothing! the process are not 
executed
   
it's like i could only execute only one instance !

how to get around ?


Y.


 





More information about the samba mailing list