Re: init: API

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 2005-11-18 at 00:20 +0200, Gilboa Davara wrote:
I, too, second the "anything but XML" statement.
A. Hard to read.
B. Hard to edit using non-XML editors. (vim in my case)
C. Tends to create needlessly-complex data structures.
D. While can be accessed using shell scripts, it requires very complex
and unreadable code.

On the other hand, what does XML offer in return?

Gilboa

I don't second that. Today XML is the format everybody uses. Why? Because it's a standardised way to put any kind of information in a text-file.
A. Depends on how the schema is created. XML files can be easy to read or dificult. Identing the xml code always helps.
B. Colored syntax always helps. That's all you usually need. At least it's enough for me. I must say that Midnight Commander seems to work with XML a little better.
C. Depends on the schema.
D. It does not require complex code, it requires well designed tools. In a XML based init world, you would need chkconfig and other tools. XML authoring should be done only by the package maintainers. The rest should be doable by external tools which share a common API.

XML could help major projects such as the directory server bypass the limitations of the current sysvinit. Check the problems with the currently proposed init scripts in the fedora-ds wiki.
I've included in this email a demo of a service configuration file for Sun SMF. Don't worry, it's not CDDL-ed. You are not contaminated if you read this.
The interesting stuff this file brings:
1) Internationalize the service descriptions (the xml:lang attribute is a dream for i18n in this case).
2) Include information about the documentation.
3) Include dependency information.
4) Include the start-up and shutdown commands.
There are a lot of other things that can be done using this XML file. These are just a few of the ones that I consider important. I've added gEdit style syntax color in the HTML version ;-).

Cheers,
Razvan

<service name='system/coreadm' type='service' version='1'>
   <create_default_instance enabled='false' />
    <single_instance />
    <dependency name='usr' grouping='require_all' restart_on='none' type='service'>
        <service_fmri value='svc:/system/filesystem/minimal'/>
    </dependency>
    <exec_method type='method' name='start' exec='/usr/bin/coreadm -u' timeout_seconds='3' />
    <exec_method type='method' name='stop' exec=':true' timeout_seconds='0' />
    <property_group name='startd' type='framework'>
        <propval name='duration' type='astring' value='transient' />
    </property_group>
    <stability value='Unstable' />
    <template>
        <common_name><loctext xml:lang='C'>
            System-wide core file configuration service.
        </loctext></common_name>
        <documentation>
            <manpage title='coreadm' section='1M' manpath='/usr/share/man' />
        </documentation>
    </template>
</service>

-- 
fedora-devel-list mailing list
fedora-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/fedora-devel-list

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Fedora Announce]     [Fedora Kernel]     [Fedora Testing]     [Fedora Formulas]     [Fedora PHP Devel]     [Kernel Development]     [Fedora Legacy]     [Fedora Maintainers]     [Fedora Desktop]     [PAM]     [Red Hat Development]     [Gimp]     [Yosemite News]
  Powered by Linux