LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 11-30-2009, 06:06 AM   #1
armtang
LQ Newbie
 
Registered: Nov 2009
Location: Yerevan, Armenia
Posts: 5

Rep: Reputation: 0
Question Dual Samba


Hi all.
I have samba working on my Ubuntu box, but I need to have two config files for it (for some specific reason...).
Q. Is there a way to assign two different config files to one samba installation??
If yes, then how???
If no, I guess I'll have to install second samba. In this case how can I specify a different folder for it??

Cheers,
Armen
 
Old 11-30-2009, 07:17 AM   #2
bret381
Member
 
Registered: Nov 2009
Location: Alabama
Distribution: Arch x86_64
Posts: 650

Rep: Reputation: 79
I don't know of a way to use two config files, however I have never tried. Are you wanting to use them at the same time or use one config file today and then the other tomorrow type of thing? If the latter, you can always rename the file to config_notused or something until you use it. And I don't think it's possible to run two instances of Samba on the same computer without virtualization.

If you are looking into virtualization, I'm not sure if Ubuntu comes with Xen installed, but it works very well. Also Virtualbox and I'm sure others can give a whole list of other virtualization software packages.
 
Old 12-01-2009, 03:36 AM   #3
armtang
LQ Newbie
 
Registered: Nov 2009
Location: Yerevan, Armenia
Posts: 5

Original Poster
Rep: Reputation: 0
Well I don't think there is any need of virtualization here. Yes I want to run them simultaneously. The thing is that I have two network interfaces on the box, and I want to access two different folders with the same share name in case of different IP addresses (this will be done via the 'interfaces' parameter in smb.conf file). That's why I need to have two different config files (the 'interfaces' parameter has a global scope). Are you sure that I can't have two instances of a daemon on one box running at the same time??
I think installing a second samba server on the box will solve the issue. I just need to install it in a different root folder (maybe even rename the daemon). I just need to know how.

Thanks anyway,
Armen
 
Old 12-01-2009, 04:41 AM   #4
michaelk
Moderator
 
Registered: Aug 2002
Posts: 25,699

Rep: Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895Reputation: 5895
Google? Its geared toward Redhat configuration / file locations so you will have to make a few changes.
http://wiki.samba.org/index.php/Mult...rver_Instances

Last edited by michaelk; 12-01-2009 at 04:45 AM.
 
1 members found this post helpful.
Old 12-02-2009, 06:03 AM   #5
armtang
LQ Newbie
 
Registered: Nov 2009
Location: Yerevan, Armenia
Posts: 5

Original Poster
Rep: Reputation: 0
Looks really interesting!
I'll take a look.

Thank you so much!!!
Armen
 
Old 12-09-2009, 07:37 AM   #6
armtang
LQ Newbie
 
Registered: Nov 2009
Location: Yerevan, Armenia
Posts: 5

Original Poster
Rep: Reputation: 0
Ok, the post was really helpful, and I wouldn't finish without it, many thanks to michaelk.
Just want to tell about some corrections that I've in case if someone hits the same problem.

The most important thing is that we need to directly specify the piddir, lockdir and private-dir options.
Another thing is that localost must be specified as an interface only in one of the config file (otherwise the second daemon will try to bind port 139 to localhost which is already bound => error).

Basically these are the commands:

~/usr/sbin/smbd -D -s [conffile1] --piddir='[piddir1]' --lockdir='[piddir1]' --private-dir='[privatedir1]'
~/usr/sbin/nmbd -D -s [conffile1]

~/usr/sbin/smbd -D -s [conffile2] --piddir='[piddir2]' --lockdir='[piddir2]' --private-dir='[privatedir2]'
~/usr/sbin/nmbd -D -s [conffile2]


~cat [conffile1]
...
interfaces = eth0:1 lo
bind interfaces only;
...
log file = [logpath1\samba.log.%m]
...
[share]
path = [folder1]
...

~cat [conffile2]
...
interfaces = eth0:2
bind interfaces only;
...
log file = [logpath2\samba.log.%m]
...
[share]
path = [folder2]
...


That's it!!! Works perfect.

Best,
Armen
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Samba with dual security, ADS and user as backup murmel Linux - Software 0 08-26-2009 06:27 PM
Samba in dual NT role Serena Linux - Server 1 12-04-2008 09:35 AM
Samba/NFS share same partition for dual boot? ethics Linux - General 1 11-16-2005 07:14 PM
Samba and Dual NIC eponymous Linux - Networking 1 11-16-2004 01:47 PM
Samba PDC with dual boot windows ncc2004 Linux - Software 2 09-09-2004 10:25 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 03:42 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration