Samba Daemons

The following sections provide information about the command-line parameters for smbd and nmbd.

smbd

The smbd program provides Samba’s file and printer services, using one TCP/IP stream and one daemon per client. It is controlled from the default configuration file, samba_dir/lib/smb.conf, and can be overridden by command-line options.

The configuration file is automatically reevaluated every minute. If it has changed, most new options are immediately effective. You can force Samba to reload the configuration file immediately if you send a SIGHUP to smbd. Reloading the configuration file, however, will not affect any clients that are already connected. To escape this “grandfather” configuration, a client would need to disconnect and reconnect or the server itself would have to be restarted, forcing all clients to reconnect.

Other signals

To shut down an smbd process, send it the termination signal SIGTERM (-15), which allows it to die gracefully, instead of a SIGKILL (-9). To increment the debug logging level of smbd at runtime, send the program a SIGUSR1 signal. To decrement it at runtime, send the program a SIGUSR2 signal.

Command-line options

-D

Runs the smbd program as a daemon. This is the recommended way to use smbd (it is also the default action). In addition, smbd can be run from inetd.

-d debug_level

Sets the debug (sometimes called logging) level. The level can range from to 10. Specifying the value on the command line overrides the value specified in the smb.conf file. Debug level logs only the most important messages; level 1 is normal; and levels 3 and above are primarily for debugging and slow smbd considerably.

-h

Prints command-line usage information for the smbd program.

Testing/debugging options

-a

If this option is specified, each new connection to the Samba server appends all logging messages to the log file. This option is the opposite of -o, and is the default.

-i scope

Sets a NetBIOS scope identifier. Only machines with the same identifier will communicate with the server. The scope identifier was a predecessor to workgroups, and this option is included only for backward compatibility.

-l log_ file

Sends the log messages to somewhere other than the location compiled in or specified in the smb.conf file. The default is often /usr/local/samba/var/log.smb, /usr/samba/var/log.smb, or /var/log/log.smb. The first two are strongly discouraged on Linux, where /usr may be a read-only filesystem.

-O socket_options

Sets the TCP/IP socket options, using the same parameters as the socket options configuration option. Often used for performance tuning and testing.

-o

Causes log files to be overwritten when opened (the opposite of -a). Using this option saves you from hunting for the right log entries if you are performing a series of tests and inspecting the log file each time.

-P

Forces smbd not to send out any network data. This option is typically used only by Samba developers.

-p port_number

Sets the TCP/IP port number from which the server will accept requests. Currently, all Microsoft clients send only to the default port, 139.

-s configuration_ file

Specifies the location of the Samba configuration file. Although the file defaults to /usr/local/samba/lib/smb.conf, you can override it here on the command line. Typically used for debugging.

nmbd

The nmbd program is Samba’s NetBIOS name and browsing daemon. It replies to NetBIOS-over-TCP/IP (NBT) name-service requests broadcast from SMB clients, and optionally to Microsoft’s Windows Internet Name Service (WINS) requests. Both are versions of the name-to-address lookup required by SMB clients. The broadcast version uses UDP/IP broadcast on the local subnet only, while WINS uses TCP/IP, which may be routed. If running as a WINS server, nmbd keeps a current name and address database in the file wins.dat in the samba_dir/var/locks directory.

An active nmbd program can also respond to browsing protocol requests used by the Windows Network Neighborhood. Browsing is a protocol that combines advertising, service announcement, and Active Directory. This protocol provides a dynamic directory of servers as well as the disks and printers that the servers are providing. As with WINS, this was initially done by making UDP/IP broadcasts on the local subnet. Now, with the concept of a local master browser, it is done by making TCP/IP connections to a server. If nmbd is acting as a local master browser, it stores the browsing database in the file browse.dat in the samba_dir/var/locks directory.

Signals

Like smbd, the nmbd program responds to several Unix signals. Sending nmbd a SIGHUP signal causes it to dump the names it knows about to the file namelist.debug in the samba_dir/locks directory and its browsing database to the browse.dat file in the same directory. To shut down an nmbd process and allow it to die gracefully, send it a SIGTERM (-15) signal instead of a SIGKILL (-9). You can increase the debug logging level of nmbd by sending it a SIGUSR1 signal; you can decrease it by sending a SIGUSR2 signal.

Command-line options

-D

Instructs the nmbd program to run as a daemon. This is the recommended way to use nmbd. In addition, nmbd can be run from inetd.

-d debug_level

Sets the debug (sometimes called logging) level. The level can range from to 10. Specifying the value on the command line overrides the value specified in the smb.conf file. Debug level logs only the most important messages; level 1 is normal; and levels 3 and above are primarily for debugging and slow nmbd considerably.

-h

Prints command-line usage information for the nmbd program (also -?).

Testing/debugging options

-a

If this option is specified, each new connection to the Samba server appends all logging messages to the log file. This option is the opposite of -o, and is the default.

-H hosts_ file

Loads a standard hosts file for name resolution.

-i scope

Sets a NetBIOS scope identifier. Only machines with the same identifier will communicate with the server. The scope identifier was a predecessor to workgroups, and this option is included only for backward compatibility.

-l log_ file

Sends the log messages to somewhere other than the location compiled in or specified in the smb.conf file. The default is often /usr/local/samba/var/log.nmb, /usr/samba/var/log.nmb, or /var/log /log.nmb. The first two are strongly discouraged on Linux, where /usr may be a read-only filesystem.

-n NetBIOS_name

Allows you to override the NetBIOS name by which the daemon will advertise itself. Specifying this option on the command line overrides the netbios name option in the Samba configuration file.

-O socket_options

Sets the TCP/IP socket options, using the same parameters as the socket options configuration option. Often used for performance tuning and testing.

-o

Causes log files to be overwritten when opened (the opposite of -a). This option saves you from hunting for the right log entries if you are performing a series of tests and inspecting the log file each time.

-p port_number

Sets the UDP/IP port number from which the server will accept requests. Currently, all Microsoft clients send only to the default port, 137.

-s configuration_ file

Specifies the location of the Samba configuration file. Although the file defaults to /usr/local/samba/lib/smb.conf, you can override it here on the command line. Typically used for debugging.

-v

Prints the current version of Samba.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset