![]()
|
SysAdmin Topics
|
The default samba service provided with Solaris 10 08/07 provides access to the smb daemon only. This can be added as a separate service. But instead we'll change the existing samba service to provide both daemons as separate instances of the samba service. To obtain the current manifest you should export it from the repository. # svccfg export samba > samba.xml This gives us the working document we will edit. The changes we will make are:
Other changes we can make include:
The modified samba.xmlsamba.xml <?xml version='1.0'?> <!DOCTYPE service_bundle SYSTEM '/usr/share/lib/xml/dtd/service_bundle.dtd.1'> <service_bundle type='manifest' name='export'> <service name='network/samba' type='service' version='0'> <!-- Remove the create_default_instance and single_instance lines --> <dependency name='net-loopback' grouping='require_any' restart_on='none' type='service'> <service_fmri value='svc:/network/loopback'/> </dependency> <dependency name='net-service' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/service'/> </dependency> <dependency name='net-physical' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/network/physical'/> </dependency> <dependency name='filesystem-local' grouping='require_all' restart_on='none' type='service'> <service_fmri value='svc:/system/filesystem/local'/> </dependency> <!-- Add a dependancy for the config file --> <dependency name='config_data' grouping='require_all' restart_on='none' type='path'> <service_fmri value='file://localhost/etc/sfw/smb.conf'/> </dependency> <dependent name='samba_multi-user-server' restart_on='none' grouping='optional_all'> <service_fmri value='svc:/milestone/multi-user-server'/> </dependent> <!-- Move the smbd daemon startup methods into an instance. We'll call this instance smbd --> <instance name='smbd' enabled='false'> <exec_method name='start' type='method' exec='/usr/sfw/sbin/smbd -D' timeout_seconds='170'> <method_context/> </exec_method> <!-- change the stop method to kill all the daemons, including existing sessions --> <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'> <method_context/> </exec_method> </instance> <!-- Add the nmbd instance --> <instance name='nmbd' enabled='false'> <exec_method name='start' type='method' exec='/usr/sfw/sbin/nmbd -D' timeout_seconds='170'> <method_context/> </exec_method> <exec_method name='stop' type='method' exec=':kill' timeout_seconds='60'> <method_context/> </exec_method> </instance> <stability value='Unstable'/> <template> <common_name> <loctext xml:lang='C'>SMB file server</loctext> </common_name> <documentation> <manpage title='smbd' section='1m' manpath='/usr/sfw/man'/> <manpage title='nmbd' section='1m' manpath='/usr/sfw/man'/> <manpage title='smb.conf' section='4' manpath='/usr/sfw/man'/> </documentation> </template> </service> </service_bundle> Enabling The Modifications# svcadm disable samba # svccfg import samba.xml # svccfg delete svc:/network/samba:default # svcadm refresh samba:smbd # svcadm refresh samba:nmbd # svcadm enable samba:smbd # svcadm enable samba:nmbd Checking The ResultThe svcs command can be used to verify the services are now running, and the nmblookup command can be used to verify the machine is part of the browse group. # svcs samba
STATE STIME FMRI
online 8:34:16 svc:/network/samba:smbd
online 8:35:00 svc:/network/samba:nmbd
# svcs -p samba
STATE STIME FMRI
online 8:34:16 svc:/network/samba:smbd
8:34:16 2038 smbd
8:34:16 2039 smbd
online 8:35:00 svc:/network/samba:nmbd
8:35:00 2066 nmbd
# /usr/sfw/bin/nmblookup SMBGROUP
querying SMBGROUP on 192.168.1.255
192.168.1.138 SMBGROUP<00>
192.168.1.134 SMBGROUP<00>
192.168.1.2 SMBGROUP<00>
192.168.1.76 SMBGROUP<00>
192.168.1.1 SMBGROUP<00>
192.168.1.51 SMBGROUP<00>
|
Comments (2)
Jul 27, 2008
vmelamedov says:
Excellent Work... Thank You!Excellent Work... Thank You!
Mar 24, 2009
spit_the-dog says:
I slipped up editing the xml, i found it easy for me not yet familiar with XML t...I slipped up editing the xml, i found it easy for me not yet familiar with XML to make a mistake. There is a useful svccfg command to validate the samba.xml file before importing it.
svccfg validate samba.xml
There is the svccfg man page and I also found this useful high level guide to smf, svc, svcs and svccfg configuration which mentioned the svccfg validate option. http://www.filibeto.org/~aduritz/truetrue/solaris10/sol-smf.pdf Many thanks to Ambreesh Khanna for making this available as currently I'm trying to get to know smf, svc
.
If there is/are errors in the xml (and I had a bit of a line left over from a vi yank and put!) then you get lines of xmlly garbage. Does anyone understand this?
Once the XML file is free of typos introduced by the dumb user (me) and the same command is run, Solaris does the usual helpful Unix thing and exits 0 (no response).
Many, many thanks as there's no way I could have migrated from init.d without this.