Rolling Your Own

When making manual changes to the Samba configuration file, take care to block changes initiated from graphical applications by invoking this command:

# chflags uchg /etc/smb.conf

From that point on, the GUI will be useful only for starting, stopping, and monitoring the service—not for configuring it.

If you install your own version of Samba, you can still manage it from Server Settings by changing some of the Open Directory properties in /config/SMBServer.

To do this, open NetInfo Manager and modify the samba_sbindir and samba_bindir properties to match the location of your Samba installation. Optionally, you can modify samba_libdir, samba_vardir, and samba_lockdir. Assuming a default Samba installation, you can also change these at the command line with the following commands:

# nicl . -create /config/SMBServer samba_sbindir /usr/local/samba/bin
# nicl . -create /config/SMBServer samba_bindir /usr/local/samba/bin
# nicl . -create /config/SMBServer samba_libdir /usr/local/samba/lib
# nicl . -create /config/SMBServer samba_vardir /usr/local/samba/var
# nicl . -create /config/SMBServer samba_lockdir /usr/local/samba/var/locks

You can check your settings with this command:

# nicl . -read /config/SMBServer

In Server Settings, select Stop Windows Services, then run this command:

# killall sambadmind

The watchdog utility restarts sambadmind within seconds. Finally, go back to Server Settings, and select Start Windows Services.

If you don’t modify Open Directory properties to match ...

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.