I only was able to change :samba to samba within the service definition svc:/network/samba and not for the :default instance. But this change did not resolve the issue. When the default instance is select there is no property group method_context.
svc:/network/samba> listprop method_context framework method_context/resource_pool astring :default method_context/working_directory astring :default method_context/project astring samba ... [root at penguin:/tmp]#svccfg -s svc:/network/samba:default svc:/network/samba:default> listprop general framework general/enabled boolean true restarter framework NONPERSISTENT restarter/transient_contract count restarter/logfile astring /var/svc/log/network-samba:default.log restarter/contract count 3560 restarter/start_pid count 20214 restarter/start_method_timestamp time 1144256151.454517000 restarter/start_method_waitstatus integer 0 restarter/auxiliary_state astring none restarter/next_state astring none restarter/state astring online restarter/state_timestamp time 1144256151.460862000 restarter_actions framework NONPERSISTENT restarter_actions/restart integer restarter_actions/refresh integer restarter_actions/maint_off integer Maybe I do not fully understand how to set values for specific instances and how instances relate to services or something like that. Here is the xml for the manifest I used. <?xml version="1.0"?> <!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1"> <!-- Copyright 2005 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms. ident "@(#)samba.xml 1.0 05/02/04 SMI" --> <service_bundle type="manifest" name="SUNWsmbar:samba"> <service name="network/samba" type="service" version="1"> <create_default_instance enabled="false"/> <single_instance/> <!-- 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:///opt/csw/etc/samba/smb.conf"/> </dependency> <!-- 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> <dependency name="physical" grouping="require_all" restart_on="error" type="service"> <service_fmri value="svc:/network/physical:default"/> </dependency> <!-- 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"/> </dependency> <method_context project='samba'> <---- this where I added the method_context value for project </method_context> <exec_method type="method" name="start" exec="/lib/svc/method/samba start" timeout_seconds="60"/> <exec_method type="method" name="stop" exec="/lib/svc/method/samba stop" timeout_seconds="60"/> <exec_method type="method" name="refresh" exec="/lib/svc/method/samba refresh" timeout_seconds="60"/> <stability value="Unstable"/> <template> <common_name> <loctext xml:lang="C">SAMBA Server</loctext> </common_name> <documentation> <manpage title="samba" section="7"/> <doc_link name="samba.org" uri="http://www.samba.org/docs/"/> </documentation> </template> </service> </service_bundle> Thanks for helping me out, mark -----Original Message----- From: Stephen Hahn [mailto:s...@eng.sun.com] Sent: Wednesday, April 05, 2006 6:40 PM To: Mark Scheufele Cc: smf-discuss at opensolaris.org Subject: Re: [smf-discuss] running service within specific project * mark scheufele <mark.scheufele at diasemi.com> [2006-04-05 09:31]: > Hi, > > I've found a smf manifest for samba on the net and added the > following method_context section. > > <method_context working_directory=':default' project=':samba'> > </method_context> > > After doing that I imported the manifest which worked just fine. The > command svccfg listprop shows the following entries for > method_context: > > method_context framework > method_context/project astring :samba > method_context/resource_pool astring :default > method_context/working_directory astring :default > > To me this looks ok. But when I start the samba service with svcadm > enable the processes aren't assigned to the correct project. Yet > starting samba with the command "newtask -p samba > /lib/svc/method/samba start" assigns the processes to the samba > project. I am using solaris 10 update 1. > > Any help is appreciated. Your method_context/project value is ":samba"; you want "samba". (That is, you don't want the leading colon.) So # svccfg -s fmri/for/samba:instance > setprop method_context/project = "samba" > ^D # svcadm refresh fmri/for/samba:instance # svcadm restart fmri/for/samba:instance (The colon-prefixed values are smf(5) keywords, at least in the framework property groups.) - Stephen -- Stephen Hahn, PhD Solaris Kernel Development, Sun Microsystems stephen.hahn at sun.com http://blogs.sun.com/sch/