Section 15.3. Starting Samba


15.3. Starting Samba

Samba essentially consists of two or three daemons. A daemon is a UNIX application that runs in the background and provides services. An example of a service is the Apache Web server for which the daemon is called httpd. In the case of Samba, there are three daemons, two of which are needed as a minimum.

The Samba server is made up of the following daemons:

nmbd This daemon handles all name registration and resolution requests. It is the primary vehicle involved in network browsing. It handles all UDP-based protocols. The nmbd daemon should be the first command started as part of the Samba startup process.

smbd This daemon handles all TCP/IP-based connection services for file-and print-based operations. It also manages local authentication. It should be started immediately following the startup of nmbd.

winbindd This daemon should be started when Samba is a member of a Windows NT4 or ADS domain. It is also needed when Samba has trust relationships with another domain. The winbindd daemon will check the smb.conf file for the presence of the idmap uid and idmap gid parameters. If they are not found, winbindd bails out and refuses to start.

Example 15.3.1. A Useful Samba Control Script for SUSE Linux
#!/bin/bash # # Script to start/stop samba # Locate this in /sbin as a file called 'samba' RCD=/etc/rc.d if [z$1 == 'z']; then        echo $0 - No arguments given; must be start or stop.        exit fi if [$1 == 'start']; then        ${RCD}/nmb start        ${RCD}/smb start        ${RCD}/winbind start fi if [$1 == 'stop']; then         ${RCD}/smb stop         ${RCD}/winbind stop         ${RCD}/nmb stop fi if [$1 == 'restart']; then         ${RCD}/smb stop         ${RCD}/winbind stop         ${RCD}/nmb stop         sleep 5         ${RCD}/nmb start         ${RCD}/smb start         ${RCD}/winbind start fi exit 0 

When Samba has been packaged by an operating system vendor, the startup process is typically a custom feature of its integration into the platform as a whole. Please refer to your operating system platform administration manuals for specific information pertaining to correct management of Samba startup.

SUSE Linux implements individual control over each Samba daemon. A Samba control script that can be conveniently executed from the command line is shown in Example 15.3.1. This can be located in the directory /sbin in a file called samba. This type of control script should be owned by user root and group root, and set so that only root can execute it.

A sample startup script for a Red Hat Linux system is shown in Example 15.3.2. This file could be located in the directory /etc/rc.d and can be called samba. A similar startup script is required to control winbind. If you want to find more information regarding startup scripts please refer to the packaging section of the Samba source code distribution tarball. The packaging files for each platform include a startup control file.



    Samba-3 by Example. Practical Exercises to Successful Deployment
    Samba-3 by Example: Practical Exercises to Successful Deployment (2nd Edition)
    ISBN: 013188221X
    EAN: 2147483647
    Year: 2005
    Pages: 142

    flylib.com © 2008-2017.
    If you may any questions please contact us: flylib@qtcs.net