Building an embedded Samba4

simo idra at samba.org
Wed Feb 1 14:02:00 GMT 2006


On Wed, 2006-02-01 at 11:40 +0100, Tomasz Chmielewski wrote:
> Andrew Bartlett schrieb:
> > Tomasz,
> > 
> > In your search for an 'embeddable' Samba PDC, I would strongly urge you
> > to consider building this on Samba4. 
> 
> Actually, I built the thing already (well, almost, but only the details 
> are missing).
> 
> It is based on OpenLDAP 2.3.18 (working as a slave, but can be a master, 
> too) and Samba 3.0.21a, and basically, provides everything a Samba from 
> a "normal" distro provides (CUPS, acls [1], users in LDAP, etc.).
> 
> It works on an ASUS WL-500g Deluxe router (it costs about 90 USD/euro, 
> there are other models, too[2]): 32 MB RAM, 200 MHz mipsel CPU, 5 
> ethernet ports, wireless, but can be installed on much more - so after 
> connecting a DSL modem to it, it can be a router + domain controller for 
> a small office (4 ethernet ports are left after connecting a DSL modem, 
> so it would be perfect for an office of 4 workers).

With a such low memory foot print I think samba4 is a way better fit.

> If you wonder how an embedded device can store user profiles, the 
> answers is simple - it has a USB-stick attached :)
> As typical USB-sticks can take 100.000 - 1.000.000 writes, depending on 
> the model, I assume it will be able to live for a couple of years.

It depends on the type of file system you use, normal file systems tends
to do more writes in the superblocks and if they are journaled in the
journal, these parts may get destroyed faster. But I know there are
filesystems designed with that in mind.
Consider also that samba is database driven and works a lot with tdb
files, where do you keep them ?
Same here for the openldap database.

> Right now, it uses about 15-20 MB of RAM (out of 32 MB), although it 
> runs quite a bit of things:
> 
> 1) slapd + smbd + nmbd + cups for a "normal" Samba file+print server 
> experience

samba3 forks a new process at each connection and can suck up 2-4M per
user ... samba4, in single mode is much more memory conservative.
On the converse, samba3 is well stable, samba4 is under heavy
development.

> The only thing I don't like about it is that Samba needs to fetch users 
> not only from LDAP, but also from the system.
> As this tiny system doesn't have NSS (it's uClibc), I have to generate 
> /etc/passwd and /etc/group from the LDAP, which is a bit ugly.

changing samba4 to not require system provided users is much more easy,
but samba4 has it's own ldap server and doesn't yet support replication.

Simo.

-- 
Simo Sorce
Samba Team
email: idra at samba.org
http://samba.org/~idra



More information about the samba-technical mailing list