Nicolas Williams wrote: >On Tue, Jan 09, 2007 at 11:29:22PM +1100, Darren Reed wrote: > > >>Looking at the SMF properties for IPFilter, one of the >>entries is presented like this: >> >>config/entities fmri file://localhost/etc/ipf/ipf.conf >> >> > >File dependencies are problematic because... > >
I'm not interested in the "dependency problem" and they are irrelevant to what the problem/idea is all about. It is just an unfortunate circumstance that the configuration file for svc:/network/ipfilter has been put in SMF as a dependency. >>If I wanted to use http:// here, is this an appropriate >>property to use or should this one be deprecated >>and another used? >> >> > >For non-local files the problem described above gets much worse. >Depending on the protocol in question you might have to poll. > > > >>Which leads on to the real question and desire... >> >>If I want to store a file location in an SMF property, I'd >> >> > >You certainly can. But not as a file dependency, unless the file is >accessible through a normal path, and then you still have the problem >described above. > > > >>like to be able to use that file location from a manifest >>without having to build knowledge of how to interpret >>the string as a URI into the manifest. >> >>Hmmm, in case that sounds like double dutch, as an >>example of what I'd like to be able to do in the startup >>script for ipfilter is the following >> >>$configfile = smf_fetchfile(`svcprop -p config/entities >>svc:/network/ipfilter`) >>ipf -f $configfile >> >> > >But why should this 'fetchfile' utility be seen as SMF-specific? > > Hmm, you've got me thinking, so let me think about this... Let's see, the smf_fetchfile(): (1) needs to ensure the pathname returned is part of the filesystem (2) should preferentially cache said file if it isn't local (3) potentially be able to return a local filename for a cached copy if the remote one cannot be checked Should it be SMF specific? No, I can't see why it needs to be. But the primary focus of the idea is to make it easier to write SMF manifest scripts, so it needs to either be a program that lives in /bin or a shell library function. I'm not aware of any general purpose shell library files that you can "source" from your own shell script on Solaris, so going that path doesn't seem like an option. In implementing (2) and (3) above, it may be desirable for the smf_fetchfile() to use a "private" directory/cache. Darren