Configuring samba server in Mac OS X Leopard

If you don’t have Mac OS X Leopard server you have a Samba implementation limited mostly to home directories and a lot of borking around, if you’re a typical Unix Admin as I am you’ll want to take things in your hands and add the shares you want yourself in the command line.

Leopard uses Samba 3 and its own authentication and locking methods connected to its auth layer and afp locking so a typical samba config file won’t work, it also has a dynamically modificable part which is configured via System Preferences.

This is not the smartest method neither prepared for faint hearted people, but it’ll work if you’re used to Linux.

If you had samba already working on Tiger the changes are only at locking, vfs and user auth, which is what enables all the new Leopard system to work properly.

This are the exact changes from Tiger to Leopard

You want to take a look at the realm SHA1 strings since they’re dependant on your installation, you can always check the new /etc/smb.conf in Mac OS X Leopard and then merge it up with your previous config, or replace the config as I did and just add this.

The Leopard samba configuration is brilliant, but at the same time limited to push you to buy the Server version, at the same time it’s interesting to play with the includes it adds too, but this at least will get your previous samba config out and running fine.

Pushing the limits of Expose

After this interesting article in Digg I decided out of boredom to try this up myself, here’s the result.

expose_limits

After this I noticed that the concurrent file limit by default in Mac OS X is quite low! Only around 200 processes per user, which even if it’s more than enough for most users sometimes depending on what you do you need more ;)

Mac OS X respects the sysctl.conf kernel parameter file as most unix do, so it’s just a question of adding the following parameter there:

kern.maxproc=2048kern.maxprocperuid=512kern.sysv.shmmax=167772160kern.sysv.shmmin=1kern.sysv.shmmni=32kern.sysv.shmseg=8kern.sysv.shmall=65536

I noticed after raising the processes value that the shared memory values where low as well, so it’s a good option to change them all at the same time.

Of course this configuration is not really recommended for machines with less than 1Gb of RAM, so be careful!

Also you need to raise the limit on launchd, launchd is Apple replacement for initd and it manages the initial limits for users.

Just edit (or create /etc/launchd.conf) and add:

limit maxproc 1024 2048limit maxfiles 2048 4096