Changeset 45344 for trunk/doc-new


Ignore:
Timestamp:
Jan 14, 2009, 3:27:24 AM (10 years ago)
Author:
markd@…
Message:

Address #17979.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/doc-new/guide/xml/portfile-startupitem.xml

    r33106 r45344  
    157157    automatically knows how to monitor a daemon process and restart it if it
    158158    dies. Daemons used with <quote>executable</quote> StartupItems may be
    159     programs or scripts (shell, perl, python, etc.), but when a script is used
    160     the script <emphasis>itself</emphasis> must be the daemon, rather than
    161     merely what launches the daemon (for the latter,<quote>script</quote>
    162     StartupItems are to be used).</para>
     159    programs or scripts (shell, perl, python, etc.) as long as the script
     160    <emphasis>itself</emphasis> is the daemon, rather than merely what
     161    launches the daemon. In the latter case <quote>script</quote> StartupItems
     162    are to be used.</para>
    163163
    164164    <note>
    165       <para>For a given port, the <quote>executable</quote> StartupItem
    166       keyword may not be used with any keywords in the <quote>script</quote>
    167       StartupItem category.</para>
     165      <para>Since <quote>script</quote> and <quote>executable</quote> are
     166      mutually exclusive StartupItem types, the
     167      <code>startupitem.executable</code> keyword may not be used in a
     168      Portfile that uses <quote>script</quote> StartupItem keywords.</para>
    168169    </note>
    169170
     
    209210            <programlisting>startupitem.executable    ${prefix}/sbin/vm-pop3d -d 10 -t 600</programlisting>
    210211
    211             <para> generates a .plist file with these tags:</para>
     212            <para>generates a .plist file with these tags:</para>
    212213
    213214            <programlisting>&lt;key&gt;ProgramArguments&lt;/key&gt;
     
    232233    <title>Script StartupItems</title>
    233234
    234     <para>StartupItems of type <quote>script</quote> use
    235     <command>daemondo</command> to launch a daemon
    236     <emphasis>indirectly</emphasis> via a startup script. A typical snippet of
    237     a startup script that may be used with a <quote>script</quote> StartupItem
    238     is shown below. Notice that the script is not a daemon; rather the script
    239     indirectly launches the vm-pop3d daemon.</para>
     235    <para>StartupItems of type <quote>script</quote> create a wrapper during
     236    port installation for <command>daemondo</command> that that will be used
     237    to launch a daemon startup script present in an application's source
     238    distribution (MacPorts does not create daemon startup scripts) for daemons
     239    that require a script.</para>
     240
     241    <note>
     242      <para><quote>Executable</quote> StartupItems are the preferred type
     243      since <quote>script</quote> StartupItems launch daemons
     244      <emphasis>indirectly</emphasis>, and this requires that port authors use
     245      the <code>startupitem.pidfile</code> keyword so that
     246      <command>daemondo</command> can check this pid file to see is a daemon
     247      process has died and restart it. Any time a script (or an executable)
     248      itself serves as a daemon, use the <quote>executable</quote> StartupItem
     249      type so daemondo will launch it directly and track its health
     250      automatically. Additionally, since <quote>script</quote> and
     251      <quote>executable</quote> are mutually exclusive StartupItem types, the
     252      <code>startupitem.executable</code> keyword may not be used in a
     253      Portfile that uses <quote>script</quote> StartupItem keywords.</para>
     254    </note>
     255
     256    <para>A typical snippet of a startup script that may be used with a
     257    <quote>script</quote> StartupItem is shown below. Notice that the script
     258    is not a daemon; rather the script indirectly launches the vm-pop3d
     259    daemon.</para>
    240260
    241261    <programlisting>#!/bin/sh
     
    247267
    248268[... trimmed ...]</programlisting>
    249 
    250     <para>But if a script itself is a daemon, use the
    251     <quote>executable</quote> StartupItem type since that way it will be
    252     launched directly and its health tracked automatically. When using
    253     <quote>script</quote> StartupItems, the <code>startupitem.pidfile</code>
    254     keyword must be used if you want <command>daemondo</command> to monitor a
    255     daemon process and restart it if it dies.</para>
    256 
    257     <note>
    258       <para>For a given port, StartupItem keywords in category
    259       <quote>script</quote> may not be used with an <quote>executable</quote>
    260       StartupItem keyword.</para>
    261     </note>
    262269
    263270    <variablelist>
Note: See TracChangeset for help on using the changeset viewer.