lianep at eng.sun.com wrote:
> Stacey Marshall writes:
>
>   
>> I, like James, wanted the same ability but for dns/server.
>>     
>
> Then you also need to file a similar bug as Jim found for ssh.
> The dns/server service needs to make its config file location 
> configurable as a service property.
>
> (It shouldn't be specified as a dependency either.)
>   
But /etc/named.conf has always been the dependency, I mean before smf(5):

# cat -n /etc/init.d/inetsvc | head -81 | tail -10
    72  #
    73  # If this machine is configured to be an Internet Domain Name 
System (DNS)
    74  # server, run the name daemon.  Start named prior to: route add 
net host,
    75  # to avoid dns gethostbyname timout delay for nameserver during 
boot.
    76  #
    77  if [ -f /usr/sbin/in.named -a -f /etc/named.conf ]; then
    78          echo 'starting internet domain name server.'
    79          /usr/sbin/in.named &
    80  fi
    81 

Surely it makes sense to keep this dependency. 

Further more use the dependency FMRI as the
location that named should use for the configuration file:


    /*
     * Within the SMF framework the default location of the
     * configuration file is held within the application instance
     * property in the form of an FMRI. If unable to detect a
     * valid configuration file then exit.  Note that this
     * condition should not occur as the service should not have
     * been started if the property or file did not exist!
     */
    prop = scf_simple_prop_get(NULL, instance, "config_data", "entities");
    if (prop == NULL) {
        ns_main_earlywarning("scf_simple_prop_get() failed: %s:"
            "Unable to retreave configuration file FMRI.",
            scf_strerror(scf_error()));
        exit(SMF_EXIT_ERR_CONFIG);
    }
    numvals = scf_simple_prop_numvalues(prop);
    if (numvals <= 0) {
        ns_main_earlyfatal("scf_simple_prop_numvalues() returned %d!"
            "  Unable to retreave configuration file FMRI.", numvals);
    } else {
        prop_str = scf_simple_prop_next_ustring(prop);
        if (prop_str != NULL) {
            if (strncmp(prop_str, "file:///",
                sizeof ("file:///") - 1) == 0) {
                fn = prop_str + sizeof ("file:///"); }
            else if (strncmp(prop_str, "file://localhost/",
                sizeof ("file://localhost/") - 1) == 0) {
                fn = prop_str +
                    sizeof ("file://localhost") - 1;
            } else if (strncmp(prop_str, "file://",
                sizeof ("file://") - 1) == 0) {
                fn = prop_str + sizeof ("file://") - 1;
                /* search for the next '/'. */
                fn = strchr(fn, '/');
            }
        } else {
            ns_main_earlyfatal("scf_simple_prop_next_ustring():"
                " Failed to get FMRI!");
        }
    }

    /*
     * If we were unable to understand the FMRI then place the
     * server in maintenance mode waiting for administrator
     * intervention.
     */
    if (fn == NULL) {
        ns_main_earlyfatal(
            "FMRI format not supported: \"%s\":"
                " Please use an FMRI format of"
                "file://localhost/path/to/config_file",
                prop_str);
    }

>   
>> For example I wanted to leave the :default instance and add
>> another with the following differences:
>>
>> start/user astring named
>> start/privileges astring 
>> basic,!proc_session,!proc_info,!file_link_any,net_privaddr,file_dac_read,file
>> _dac_search,sys_resource,proc_chroot
>> config_data/entities fmri file://localhost/var/named/named.conf
>>     
>
> As I mentioned above, this isn't sufficient, to specify an 
> alternate config file for named to actually use?
>   
Which is the bug that my code above would address.
> It seems like even if it was, the tricky bit is your desire to 
> overwrite the user the start method runs as, right?  You're not looking 
> to completely duplicate the instance's config so much as tweak a few 
> property groups just a little bit.
>   
Both possibilities exist, their is a requirement to run one service 
multiple times.
> That seems like a reasonable RFE for SMF to provide help with on the 
> command line.  I've just filed 6452754 to capture what I think the 
> requirements are.  
>   
That would help. It is possible that one would simply want to duplicate 
everything as-is except for one parameter. 
> Visual Panels will make this *lots* easier if you're willing to use a GUI.
>
> But even if we gave you code for 6452754, you'll still need to file a bug
> against dns/server to get it to read a config file property.  I 
> strongly encourage you to do that, and please add me to the interest
> list. :)
>   
> thanks,
> liane
>   
Thanks,
Stacey
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/x-pkcs7-signature
Size: 3261 bytes
Desc: S/MIME Cryptographic Signature
URL: 
<http://mail.opensolaris.org/pipermail/smf-discuss/attachments/20060726/32ed31a1/attachment.bin>

Reply via email to