ctdb_setup_state_dir "service" "$service_name"
+generate_smb_interfaces_config()
+{
+ get_public_ifaces
+ pub_iface_list=$public_ifaces
+ public_ifaces=""
+ for iface in $pub_iface_list;
+ do
+ public_ifaces="$public_ifaces \"$iface;options=dynamic\""
+ done
+
+ if [ -n "$CTDB_SAMBA_INTERFACES_EXTRA" ]; then
+ public_ifaces="$public_ifaces $CTDB_SAMBA_INTERFACES_EXTRA"
+ fi
+ public_ifaces=$(echo "$public_ifaces" | xargs -n 1 | sort -u)
+
+cat <<EOT > "$CTDB_SAMBA_INTERFACES_FILE"
+ bind interfaces only = yes
+ interfaces = lo $public_ifaces
+EOT
+}
+
service_start()
{
# make sure samba is not already started
# make absolutely sure samba is dead
killall -q -9 smbd
}
+ if [ -n "$CTDB_SAMBA_INTERFACES_FILE" ]; then
+ generate_smb_interfaces_config
+ fi
# start Samba service. Start it reniced, as under very heavy load
# the number of smbd processes will mean that it leaves few cycles
# for anything else
</listitem>
</varlistentry>
+ <varlistentry>
+ <term>
+ CTDB_SAMBA_INTERFACES_FILE=<parameter>FILENAME</parameter>
+ </term>
+ <listitem>
+ <para>
+ Generates FILENAME, containing an smb.conf snippet with
+ an interfaces setting that includes interfaces for
+ configured CTDB public IP addresses. This file then
+ needs to be explicitly included in smb.conf.
+ </para>
+ <para>
+ For example, if public IP addresses are defined on
+ interfaces eth0 and eth1, and this is set to
+ <filename>/etc/samba/interfaces.conf</filename>, then
+ that file will contain the following before smbd is
+ started:
+ </para>
+ <screen>
+ bind interfaces only = yes
+ interfaces = lo eth0 eth1
+ </screen>
+ <para>
+ This can be useful for limiting the interfaces used by
+ SMB multichannel.
+ </para>
+ <para>
+ Default is to not generate a file.
+ </para>
+ </listitem>
+ </varlistentry>
+
+ <varlistentry>
+ <term>
+ CTDB_SAMBA_INTERFACES_EXTRA=<parameter>INTERFACE-LIST</parameter>
+ </term>
+ <listitem>
+ <para>
+ A space separated list to provide additional interfaces to bind.
+ </para>
+ <para>
+ Default is empty - no extra interfaces are added.
+ </para>
+ </listitem>
+ </varlistentry>
</variablelist>
</refsect2>