Chapter 7. Samba Plug-In

SGI Cluster Manager supports Samba as shipped with SGI ProPack for Linux. See “Software Requirements” in Chapter 1 for the supported levels.

This chapter discusses the following:

For more information about Samba, see:

http://www.samba.org/samba/docs

Samba Process ID, Locks, and Password File

The Samba process ID (PID), locks, and password file are kept in the shared partitions and in the log file on the local disk. The lock directory is not removed during failover.

The locations are as follows:

  • PID directory: mountpoint /.samba/sharename/pid

  • Log directory: /var/log/samba

  • Lock directory: mountpoint /.samba/sharename/locks

  • Password file: mountpoint /.samba/sharename/private/smbpasswd

Samba Share Configuration File

When you create a Samba service in SGI Cluster Manger, the netbios name entry is automatically added to the /etc/samba/smb.conf. SambaShareName file with a value set to the IP name associated with highly available IP address configured for the Samba service. You can modify the netbios name value as long as it remains unique for the SGI Cluster Manager cluster.

When you create a Samba service in SGI Cluster Manger, the smb passwd file entry is automatically added to the /etc/samba/smb.conf.SambaShareName file. However, when you use the smbpasswd(8) command, that entry is commented out and the private dir entry is added. For example:

#       smb passwd file = /lxvm2/.samba/samba_lxvm2/private/smbpasswd
        private dir = /lxvm2/.samba/samba_lxvm2/private

Samba Start/Stop Order

For the order in which Samba is started/stopped, see Chapter 6, “Creating a New Highly Available Application”.

Defining NFS Exports and Samba Exports

You can edit the /etc/samba/smb.conf.SambaShareName Samba configuration file that is generated by SGI Cluster Manager to include additional Samba shares.

Whether or not you change this file, you must copy it to the other member in the cluster. For examples of using the Samba Druid and NFS Druid, see “Samba Druid Example” in Chapter 4 and “NFS Druid Example” in Chapter 4.

Improving the Default smb.conf.sharename File

If you name a share SMBXVM, the Samba Druid will create the following smb.conf.SMBXVM file:

[global]
        workgroup = SGIHACLUSTER
        pid directory = /mirror/.samba/SMBXVM/pid
        lock directory = /mirror/.samba/SMBXVM/locks
        log file = /var/log/samba/%m.log
        netbios name = sauna
        smb passwd file = /mirror/.samba/SMBXVM/private/smbpasswd
        encrypt passwords = yes
        bind interfaces only = yes
        interfaces = 192.168.0.1/255.255.255.0

[SMBXVM]
        comment = High Availability Samba Service
        browsable = yes
        writable = no
        public = yes
        path = /mirror

You should modify this file as follows:

  • Change the value for workgroup. It should be 8 or fewer characters for compatibility with older CIFS clients.

  • Change the default netbios name value (which is determined by resolving the IP alias in the share) to uppercase in order to maintain compatibility with older CIFS clients.

  • Ensure that the smb passwd file is not commented out after running the smbpasswd (8) command.

  • Add the private dir parameter.

  • Change the writable value to yes so that the share can be written to.

  • Change the log file value to be on shared storage if you want the log files in the same place. (Otherwise, you must look on both members to see all of the logs.)

  • Modify the default value of max log size to suit your site.

Following is an improved smb.conf.SMBXVM file after making changes to the default file created by the Samba Druid (bold indicates changed or added lines):

[global]
        workgroup = SGIHACL
        pid directory = /mirror/.samba/SMBXVM/pid
        lock directory = /mirror/.samba/SMBXVM/locks
        log file = /var/log/samba/%m.log
        netbios name = SAUNA
        smb passwd file = /mirror/.samba/SMBXVM/private/smbpasswd
        private dir = /mirror/.samba/SMBXVM/private
        encrypt passwords = yes
        bind interfaces only = yes
        interfaces = 192.168.0.1/255.255.255.0

[SMBXVM]
        comment = High Availability Samba Service
        browsable = yes
        writable = yes
        public = yes
        path = /mirror

If you name an NT domain NT, the Samba Druid will create the standard default smb.conf.sharename file (assuming that a machine account has already been set up that has never been bound to the domain). After making the appropriate changes, the file would for example be as follows (bold indicated changed or added lines):

[global]
        workgroup = MYDOMAIN
        security = domain
        wins server = 192.168.1.2
        pid directory = /mirror/.samba/SMBXVM/pid
        lock directory = /mirror/.samba/SMBXVM/locks
        log file = /var/log/samba/%m.log
        netbios name = SAUNA
        smb passwd file = /mirror/.samba/SMBXVM/private/smbpasswd
        private dir = /mirror/.samba/SMBXVM/private
        encrypt passwords = yes
        bind interfaces only = yes
        max log size = 0
        interfaces = 192.168.1.10/255.255.255.0


[SMBXVM]
        comment = High Availability Samba Service
        browsable = yes
        writable = yes
        public = yes
        path = /mirror

After Samba is running with this configuration, you must ensure that the wins server is set properly. Run the following:

# net join -s /etc/samba/smb.conf.SMBXVM

For more information, see the smb.conf man page.

Service Monitoring Levels

For information about service monitoring levels, see “Step 8: Configure the Service” in Chapter 4.