Home | History | Annotate | Download | only in smb
      1 #!/usr/bin/ksh
      2 #
      3 # CDDL HEADER START
      4 #
      5 # The contents of this file are subject to the terms of the
      6 # Common Development and Distribution License (the License).
      7 # You may not use this file except in compliance with the License.
      8 #
      9 # You can obtain a copy of the license at usr/src/CDDL.txt
     10 # or http://www.opensolaris.org/os/licensing.
     11 # See the License for the specific language governing permissions
     12 # and limitations under the License.
     13 #
     14 # When distributing Covered Code, include this CDDL HEADER in each
     15 # file and include the License file at usr/src/CDDL.txt.
     16 # If applicable, add the following below this CDDL HEADER, with the
     17 # fields enclosed by brackets [] replaced with your own identifying
     18 # information: Portions Copyright [yyyy] [name of copyright owner]
     19 #
     20 # CDDL HEADER END
     21 #
     22 
     23 #
     24 # Copyright 2006 Sun Microsystems, Inc.  All rights reserved.
     25 # Use is subject to license terms.
     26 #
     27 #ident	"@(#)samba_config.ksh	1.6	07/06/06 SMI"
     28 #
     29 # These parameters can be customized in (key=value) form
     30 #
     31 #	+++ Resource Specific Parameters +++
     32 #
     33 #                 RS - name for the Sun Cluster Samba resource
     34 #                 RG - name of the Sun Cluster Resource Group to contain RS
     35 #	       RS_LH - name of the Sun Cluster Logical Hostname resource
     36 #	      RS_HAS - name of the Sun Cluster HAStoragePlus resource
     37 #           SERVICES - name of the Samba service(s) this resource should run
     38 #  			Valid entries are
     39 # 		   	SERVICES="smbd"
     40 #		   	SERVICES="smbd,nmbd"
     41 #		   	SERVICES="winbindd"
     42 #
     43 #	+++ Common Parameters +++
     44 #
     45 #             BINDIR - name of the Samba bin directory
     46 #            SBINDIR - name of the Samba sbin directory
     47 #             CFGDIR - name of the Samba instance configuration directory
     48 #             LDPATH - name of the Samba LD_LIBRARY paths
     49 #             FMUSER - name of the Samba fault monitor user
     50 #
     51 #	+++ SMBD & NMBD Specific Parameters +++
     52 #
     53 #       SAMBA_LOGDIR - name of the Samba log directory
     54 #       SAMBA_FMPASS - name of the Samba fault monitor user password
     55 #     SAMBA_FMDOMAIN - name of the Samba NT-domain where the fault monitor user is located
     56 #
     57 #	+++ WINBINDD Specific Parameters +++
     58 #
     59 #   WINBIND_DISCACHE - disable winbind cache (TRUE or FALSE)
     60 # WINBIND_SINGLEMODE - run winbind in single daemon mode (TRUE or FALSE)
     61 #
     62 #	+++ Zone Specific Parameters +++
     63 #
     64 #    	     RS_ZONE - name of the non-global (failover) zone managed by the
     65 #                      Sun Cluster Data Service for Solaris Containers
     66 #              LHOST - name of the Zone IP Address to be used for Samba
     67 #            PROJECT - name for the Solaris Project to be used for this resource
     68 #                      (Default PROJECT=default)
     69 #            TIMEOUT - probe timeout value
     70 #                      (Default TIMEOUT=300)
     71 #
     72 # Note 1: +++ SMBD & NMBD Specific parametes +++
     73 #	These parameter entries are only required when
     74 # 		   SERVICES="smbd"
     75 #		   SERVICES="smbd,nmbd"
     76 #	
     77 # Note 2: +++ WINBINDD Specific parametes +++
     78 #	These parameter entries are only required when
     79 #		   SERVICES="winbindd"
     80 #
     81 # Note 3: +++ Non-global (failover) zone parameters +++
     82 #       These parameters are only required when Samba should run
     83 #       within a failover zone managed by the Sun Cluster Data Service
     84 #       for Solaris Containers.
     85 #
     86 #       To use the Sun Cluster Data Service for Samba together with
     87 #       the Sun Cluster Data Service for Solaris Containers, you must do
     88 #       the following,
     89 #
     90 #       1. Install the Sun Cluster Data Service for Solaris Containers.
     91 #
     92 #       2. Follow the Sun Cluster Data Service for Solaris Containers Guide
     93 #          for instructions on how to create and install a non-global zone
     94 #          in a failover configuration.
     95 #
     96 #          The following text represents condensed documentation and shows the
     97 #          required steps to install Samba into a failover zone on a two node
     98 #          Sun Cluster.
     99 #
    100 #          On all nodes within the cluster, ensure that "exclude lofs" is commented
    101 #          out within /etc/system and that patch 120590-03 or later is installed.
    102 #
    103 #          In the examples below, Samba is installed in the failover zone's zonepath.
    104 #          /usr/local/samba are simply directories within the zone.
    105 #
    106 #          If a global or highly available local file system (instead of using the
    107 #	   zone's zonepath) is required for Samba in the failover zone, you must 
    108 #          configure the "Mounts" parameter within the sczcbt_config file in Step 3.
    109 #
    110 #          You can use a whole" or sparse root failover zone for the installation of
    111 #          Samba on both nodes of the cluster. Performing these tasks on both nodes
    112 #          of the cluster is required to ensure that the zone is "known" to
    113 #          both nodes of the cluster, i.e. configured and installed.
    114 #	
    115 #	   The following example creates a whole root zone. To create a sparse root 
    116 #	   zone, omit the "-b"  flag with the create sub-command, i.e. 
    117 #	
    118 #	   zonecfg:zone1> create 	For a sparse root zone
    119 #	   zonecfg:zone1> create -b	For a whole root zone
    120 #
    121 #          node1# scrgadm -a -g zone1-rg
    122 #          node1# scrgadm -a -g zone1-rg -L -l zone1 -j zone1-lh
    123 #          node1# scrgadm -a -g zone1-rg -t SUNW.HAStoragePlus -j zone1-has \
    124 #          node1# -x FileSystemMountPoints=<failover file system>
    125 #          node1#
    126 #          node1# scswitch -Z -g zone1-rg
    127 #          node1# scswitch -z -g zone1-rg -h node1
    128 #          node1#
    129 #          node1# zonecfg -z zone1
    130 #          zone1: No such zone configured
    131 #          Use 'create' to begin configuring a new zone.
    132 #          zonecfg:zone1> create -b
    133 #          zonecfg:zone1> set zonepath=<failover file system>/zone1
    134 #          zonecfg:zone1> set autoboot=false
    135 #          zonecfg:zone1> add inherit-pkg-dir
    136 #          zonecfg:zone1:inherit-pkg-dir> set dir=/opt/SUNWscsmb
    137 #          zonecfg:zone1:inherit-pkg-dir> end
    138 #          zonecfg:zone1> exit
    139 #          node1#
    140 #          node1# zoneadm -z zone1 install
    141 #          node1# scswitch -z -g zone1-rg -h node2
    142 #
    143 #          node2# cd <failover file system>
    144 #          node2# rm -r zone1
    145 #          node2#
    146 #          node2# zonecfg -z zone1
    147 #          zone1: No such zone configured
    148 #          Use 'create' to begin configuring a new zone.
    149 #          zonecfg:zone1> create -b
    150 #          zonecfg:zone1> set zonepath=<failover file system>/zone1
    151 #          zonecfg:zone1> set autoboot=false
    152 #          zonecfg:zone1> add inherit-pkg-dir
    153 #          zonecfg:zone1:inherit-pkg-dir> set dir=/opt/SUNWscsmb
    154 #          zonecfg:zone1:inherit-pkg-dir> end
    155 #          zonecfg:zone1> exit
    156 #          node2#
    157 #          node2# zoneadm -z zone1 install
    158 #          node2# zoneadm -z zone1 boot
    159 #
    160 #          At this stage zone1 is configured and installed, but Solaris within
    161 #          zone1 is not yet configured. This needs to be done as follows,
    162 #
    163 #          node2# zlogin -C zone1
    164 #          zone1# ~.
    165 #          node2# zoneadm -z zone1 halt
    166 #
    167 #       3. Bring online the whole root non-global zone, so that it is now
    168 #          managed by the Sun Cluster Data Service for Solaris Containers.
    169 #
    170 #          Edit sczbt_config and execute sczbt_register from /opt/SUNWsczone/sczbt/util
    171 #
    172 #          node2# cd /opt/SUNWsczone/sczbt/util
    173 #          node2# vi sczbt_config
    174 #          node2# ./sczbt_register
    175 #          node2#
    176 #          node2# scswitch -e -j <res>
    177 #
    178 #       4. Install Samba in the whole root failover zone.
    179 #
    180 #       5. Provide values for the parameters below and include values for
    181 #          RS_ZONE, LHOST, PROJECT and TIMEOUT.
    182 #
    183 #          The value for the RG= parameter should be the same SC resource group
    184 #          name that was used by the Sun Cluster Data Service for Solaris Containers
    185 #          agent for the failover zone.
    186 #
    187 #          RS_zone should also be the same SC resource name that was used by the
    188 #          Sun Cluster Data Service for Solaris Containers agent for the failover zone.
    189 #
    190 #          Refer to Example 2 - Configuration parameters for deployment of Samba
    191 #                                within a Solaris 10 non-global (failover) zone.
    192 #
    193 #          node2# vi samba_config
    194 #
    195 #       6. Register the SC resource using the samba_register script.
    196 #
    197 #          node2# ./samba_register
    198 #
    199 #       7. Bring online the SC resource that was registered.
    200 #
    201 #          node2# scswitch -e -j <res>
    202 #
    203 # Example 1 - Configuration parameters for deployment of Samba
    204 #               within Solaris 10 global zone nodes or pre-Solaris 10 nodes.
    205 #
    206 #	The following example uses Samba packaged with Solaris, where the Samba
    207 #	instance configuration directory is on a failover file system named
    208 #	/local/samba/PDC
    209 #
    210 #	+++ Resource Specific Parameters +++
    211 #	RS=pdc
    212 #	RG=samba-rg
    213 #	RS_LH=pdc-lh
    214 #	RS_HAS=pdc-has
    215 #	SERVICES="smbd,nmbd"
    216 #
    217 #	+++ Common Parameters +++
    218 #	BINDIR=/usr/sfw/bin
    219 #	SBINDIR=/usr/sfw/sbin
    220 #	CFGDIR=/local/samba/PDC
    221 #	LDPATH=/usr/sfw/lib
    222 #	FMUSER=samba
    223 #
    224 #	+++ SMBD & NMBD Specific Parameters (See Note 1) +++
    225 #	SAMBA_LOGDIR=/local/samba/PDC/logs
    226 #	SAMBA_FMPASS=samba
    227 #	SAMBA_FMDOMAIN=
    228 #
    229 #	+++ WINBIND Specific Parameters (See Note 2) +++
    230 #	WINBIND_DISCACHE=FALSE
    231 #	WINBIND_SINGLEMODE=FALSE
    232 #
    233 #	+++ Zone Specific Parameters (See Note 3) +++
    234 #	RS_ZONE=
    235 #	LHOST=
    236 #	PROJECT=default
    237 #	TIMEOUT=30
    238 #
    239 #
    240 # Example 2 - Configuration parameters for deployment of Samba
    241 #               within a Solaris 10 non-global (failover) zone.
    242 #
    243 #	The following example uses Samba downloaded and compiled into 
    244 #	/opt/samba, where the samba instance configuration directory is 
    245 #	on a failover file system named /local/samba/DMS1
    246 #
    247 #	Note that if you require the latest version of Samba or a newer
    248 #	Samba version to that packaged with Solaris, you will need to 
    249 #	download and compile Samba. The following example uses /opt/samba
    250 #	for the location of Samba after it has been downloaded and compiled.
    251 #
    252 #	You may of course have chosen a different location. Refer to the 
    253 #	Sun Cluster Dataserivce for Samba Guide for an example of downloading 
    254 #	and compiling Samba. 
    255 #
    256 #	+++ Resource Specific Parameters +++
    257 #	RS=zone1-dms1
    258 #	RG=zone1-rg
    259 #	RS_LH=zone1-lh
    260 #	RS_HAS=zone1-has
    261 #	SERVICES="smbd"
    262 #
    263 #	+++ Common Parameters +++
    264 #	BINDIR=/opt/samba/bin
    265 #	SBINDIR=/opt/samba/sbin
    266 #	CFGDIR=/local/samba/DMS1
    267 #	LDPATH=/opt/samba/lib
    268 #	FMUSER=samba
    269 #
    270 #	+++ SMBD & NMBD Specific Parameters (See Note 1) +++
    271 #	SAMBA_LOGDIR=/local/samba/DMS1/logs
    272 #	SAMBA_FMPASS=smb4#ads
    273 #	SAMBA_FMDOMAIN=
    274 #
    275 #	+++ WINBIND Specific Parameters (See Note 2) +++
    276 #	WINBIND_DISCACHE=FALSE
    277 #	WINBIND_SINGLEMODE=FALSE
    278 #
    279 #	+++ Zone Specific Parameters (See Note 3) +++
    280 #	RS_ZONE=zone1
    281 #	LHOST=192.168.100.198
    282 #	PROJECT=default
    283 #	TIMEOUT=30
    284 #
    285 #+++ Resource Specific Parameters +++
    286 RS=
    287 RG=
    288 RS_LH=
    289 RS_HAS=
    290 SERVICES="smbd,nmbd"
    291 
    292 #+++ Common Parameters +++
    293 BINDIR=
    294 SBINDIR=
    295 CFGDIR=
    296 LDPATH=
    297 FMUSER=
    298 
    299 #+++ SMBD & NMBD Specific Parameters (See Note 1) +++
    300 SAMBA_LOGDIR=
    301 SAMBA_FMPASS=
    302 SAMBA_FMDOMAIN=
    303 
    304 #+++ WINBIND Specific Parameters (See Note 2) +++
    305 WINBIND_DISCACHE=FALSE
    306 WINBIND_SINGLEMODE=FALSE
    307 
    308 #+++ Zone Specific Parameters (See Note 3) +++
    309 RS_ZONE=
    310 LHOST=
    311 PROJECT=default
    312 TIMEOUT=30
    313