Summary: Solaris 10 Windows integration

From: Andreas Höschler <>
Date: Wed Feb 27 2008 - 18:13:37 EST
Dear managers,

thanks to

"Martin Marshall" <>
francisco roque <>
Matthew Taylor <>
"Monappallil, George" <> (Karl Vogel)

for their kind responses. It's working for me now. Please find attached 
my notes.



Samba is already preinstalled on Solaris 10.

	pkginfo -l | grep samba

       NAME:  samba - A Windows SMB/CIFS fileserver for UNIX (client)
       DESC:  samba - A Windows SMB/CIFS fileserver for UNIX (client) 
       NAME:  samba - A Windows SMB/CIFS fileserver for UNIX (Root)
       DESC:  samba - A Windows SMB/CIFS fileserver for UNIX (Root) 
       NAME:  samba - A Windows SMB/CIFS fileserver for UNIX (Usr)
       DESC:  samba - A Windows SMB/CIFS fileserver for UNIX (Usr) 

We save the old rc* scripts as follows. Who knows may be we need them 

	ls -l /etc/rc?.d/???samba

-rwxr--r--   6 root     sys          324 Jul  3  2006 
-rwxr--r--   6 root     sys          324 Jul  3  2006 
-rwxr--r--   6 root     sys          324 Jul  3  2006 
-rwxr--r--   6 root     sys          324 Jul  3  2006 
-rwxr--r--   6 root     sys          324 Jul  3  2006 

	tar cvpf - /etc/rc?.d/???samba | gzip -c > /var/tmp/etc-rc-samba.tar.gz

This archive can be extracted again as follows if we need these files 

	gunzip < /var/tmp/etc-rc-samba.tar.gz | tar -tvpf -

We can delete the scripts now but let's wait with that until the 
services are up and running.

	rm /etc/rc?.d/???samba

We create the sbm.conf file and make sure it looks as indicated below:

	cd /etc/sfw
	mv smb.conf smb.conf.orig
	cp smb.conf-example smb.conf
	pico /etc/sfw/smb.conf

         server string = Samba Server
         interfaces =
         bind interfaces only = Yes
         log level = 1
         syslog = 0
         log file = /var/log/samba/%m.log
         max log size = 50

         path = /home/%u

         comment = All Printers
         path = /var/spool/samba
         printable = Yes
         browseable = No

We create /var/log/samba before starting smb.

	mkdir /var/log/samba
	tail -f /var/log/samba/smbd.log

We used the start script supplied by Sun.

	pico /etc/init.d/samba

case "$1" in
	/usr/sfw/sbin/smbd -D
	/usr/sfw/sbin/nmbd -D
	pkill smbd
	pkill nmbd
	echo "Usage: $0 { start | stop }"
	exit 1
exit 0

	chmod a+x /etc/init.d/samba

We create a manifest file for setting up the service:

	pico /var/svc/manifest/network/samba.xml

<?xml version='1.0'?>
<!DOCTYPE service_bundle SYSTEM 
<service_bundle type='manifest' name='WISWsamba:samba'>
   <service name='site/samba' type='service' version='0'>
     <create_default_instance enabled="false"/>
         First of all, if the config file is not present,
         then we needn't bother with anything else.
     <dependency name="config-file" grouping="require_all" 
restart_on="none" type="path">
       <service_fmri value="file:///etc/sfw/smb.conf"/>

       If there's no network, then there's no point in running
     <dependency name='loopback' grouping='require_all' 
restart_on='error' type='service'>
       <service_fmri value='svc:/network/loopback:default'/>
     <dependency name='physical' grouping='optional_all' 
restart_on='error' type='service'>
       <service_fmri value='svc:/network/physical:default'/>

       Since Samba may be providing a home directory service,
       it is as well that we ensure that the file-systems are
       all mounted before it is started. This is not essential
       but in general it is a good thing and doesn't really hurt.
     <dependency name='fs-local' grouping='require_all' 
restart_on='none' type='service'>
       <service_fmri value='svc:/system/filesystem/local'/>

       now we have the start stop and refresh methods
     <exec_method name='start' type='method' exec='/etc/init.d/samba 
start' timeout_seconds='60'>
     <exec_method name='stop' type='method' exec='/etc/init.d/samba 
stop' timeout_seconds='60'>

     <property_group name='samba' type='application'>
       <stability value='Evolving'/>
     <property_group name='startd' type='framework'>
       <propval name='ignore_error' type='astring' value='core,signal'/>

     <stability value='Evolving'/>
       A description of the Service
         <loctext xml:lang='C'>Samba Server</loctext>
         <manpage title='samba' section='1M'/>
         <doc_link name='' uri=''/>

We doublecheck the manifest for errors and then start the service.

	svccfg validate /var/svc/manifest/network/samba.xml

	svcadm -v disable samba
	svccfg delete samba

	svccfg import /var/svc/manifest/network/samba.xml

	svcadm -v enable samba
	svcs -a | grep samba
	svcs -vx  svc:/site/samba:default
	svcs -l  svc:/site/samba:default
	svcadm restart svc:/system/svc/restarter:default
	ps -Af | grep smbd
	ps -Af | grep nmbd

We also add a service for the swat administration tool.

	pico /etc/services

swat            901/tcp                      # Samba Web Administration 

	pico /etc/inetd.conf

We add the following to /etc/inetd.conf

swat   stream   tcp   nowait   root   /usr/sfw/sbin/swat   

and run

	inetconv -f -o /var/tmp

This gives us

	swat -> /var/tmp/swat-tcp.xml
	Importing swat-tcp.xml ...Done

	inetadm -e svc:/network/swat/tcp:default
	svcs -a | grep swat
	svcs -l  svc:/network/swat/tcp:default
	inetadm -l svc:/network/swat/tcp:default
We can now access the samba administration page via the following URL:


On the Solaris machine we create the samba user accounts we would like 
to grant access to samba resources to.

	smbpasswd -a ahoesch

These accounts should already exist on the Windows Server and in 
/etc/passwd on the Solaris machine. On the Solaris machine we can do

	/usr/sfw/bin/smbclient -L SF490

to see which recources we have access to. It asks for a password of the 
current user which must be an existing samba user (smbpasswd -a ...), 
so if we run this command as root we should have done "smbpasswd -a 
root" before.

We can now log into the windows machine, e.g. using the Sun Ray windows 

	/opt/SUNWutssc/bin/utssc -l de-DE -g 1024x768 <ipaddress of windows 

and then click on

	Start - Arbeitsplatz - Netzwerkumgebung - Arbeitsgruppencomputer 
anzeigen - Microsoft Windows Netwerk - Workgroup - Sambe Server (SF490) 
- homes

On any unix client with samba installed we could use

	smbclient //SF490/ahoesch

to access resources.

In case of problems check

	tail -f /var/log/samba/smbd.log

or try to start smbd manually with

	/usr/sfw/sbin/smbd -i

The following settings solved a "bind failed on port 139 socket_addr =  Error = Address already in use" problem for me.

         interfaces =
         bind interfaces only = Yes
sunmanagers mailing list
Received on Wed Feb 27 18:14:14 2008

This archive was generated by hypermail 2.1.8 : Thu Mar 03 2016 - 06:44:10 EST