Liane Praza wrote: > Shawn Walker wrote: >> Liane Praza wrote: >>> Shawn Walker wrote: >>>> Greetings, >>>> >>>> I had some questions about SMF manifests that I was hoping someone >>>> could answer. I've spent read through the available documentation >>>> that I could find, but I still could not find anything that explains >>>> these items: >>>> >>>> 1. What are the differences between the different propval types >>>> (e.g. count, integer, etc.)? Is there a document somewhere that >>>> explicitly defines what each of these data types expects for a value >>>> (format, limits, etc.)? >>> >>> Hopefully the table in scf_value_create(3scf) helps. >> >> It would be really great if this were documented in the service_bundle >> manpage or in the dtd itself :| > > There's already a bug that service_bundle is woefully short. It'd be > helpful if you could file one against the DTD, too, though. > >> >>>> 2. Is it possible to create property groups of property groups >>>> (the dtd suggests that this is not possible)? >>> >>> Correct. Not possible. >> >> Hrm, someone mentioned that: >> >> You can manage a pool of configuration values using the property group >> mechanism, with an overall property group listing the relevant group >> or groups for each member. >> >> What did they mean by that then? > > I have some ideas. (A property group which contains a property with a > list of property groups that should be incorporated is my best guess.) > But, without understanding the configuration you're modeling, and > without being the person who suggested this, I can only guess. :)
The locale grouping I mentioned previously. My thought was that the modeling would be something like repository/property/locale. >>>> 3. Is it possible to conditionally specify options to a program >>>> in its start method based on a property value? In other words, if I >>>> have: >>>> >>>> <propval name='error_log' type='astring' value='stderr' /> >>>> >>>> ...can my start method conditionally include a --log-errors >>>> command-line option to my program based on the value of the propval? >>> >>> Sure. Most people do this like it's done in >>> /lib/svc/method/console-login. >> >> So the workaround is to use a wrapper script that manipulates >> svcprops. Was hoping for something in the XML, but if I have to, that >> will do. > > You can directly incorporate properties using the %{} syntax in a > method. But, that's rarely a reasonable specification for command line > options because then you just end up with a property list of command > line options, and no way to do upgrade of the configuration later > without parsing the list and guessing (usually poorly) at the admin's > intent. Ah ha. Thank you for noting that pitfall. >>>> 4. I have a need for users to be able to specify values to the >>>> program based on locale. This is not the locale that the program is >>>> running in, but the locale of the content being generated by the >>>> program. For example, I have a property group called "repository" >>>> and a propval called "name". What is the best way for them to be >>>> able to specify a value for "name" for each locale (e.g. en, fr, etc.)? >>> >>> We currently do this with a convention of appending the locale name >>> to the property name. We don't have explicit formal support for it >>> at this point, though. >> >> That format would require me to specify a propval for each supported >> locale though would it not? Would it be better to use a >> multiple-value property instead and have the user pre-pend the locale >> to each value (e.g. en:value, fr:value)? > > Why would you need to specify one a priori? The property would just be > created by your UI when it was specified by the user, I'd think. I have no such interface, it seems I can just document how to do it with svcprop for now and let the user take care of it. Thanks, -- Shawn Walker