Configuration Details

Underneath the GUI, a lot of activity takes place to offer Windows Services. In the non-Server version of Mac OS X, selecting Windows File Sharing sets the SMBSERVER parameter in /etc/hostconfig and triggers the Samba startup item. In Mac OS X Server, under normal circumstances the Samba startup item and the SMBSERVER parameter are never used.

Instead, a process named sambadmind generates /etc/smb.conf from the configuration specified in Server Settings and Workgroup Manager and handles starting and restarting the Samba daemons as necessary. The sambadmind process is in turn monitored by watchdog, which keeps an eye on certain processes and restarts those which fail. The watchdog utility is configured in /etc/watchdog.conf, a file similar to a System V inittab, which specifies how the services under watchdog’s purview are to be treated. For example, the line for sambadmind looks like this:

sambadmin:respawn:/usr/sbin/sambadmind -d     # SMB Admin daemon

Using a watchdog-monitored process such as sambadmind to start the Samba daemons, instead of a one-time execution of a startup item, results in more reliable service. In Mac OS X Server, if a Samba daemon dies unexpectedly, it is quickly restarted. (Examples of other services monitored by watchdog are Password Server, Print Service, and the Server Settings daemon that allows remote management.)

There’s another wrinkle in Mac OS X Server: the Samba configuration settings are not written directly to /etc/smb.conf, as ...

Get Using Samba, Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.