[svnbook] r3945 committed - * src/en/book/ch06-server-configuration.xml...

svnbook at googlecode.com svnbook at googlecode.com
Tue Aug 2 15:06:51 CDT 2011


Revision: 3945
Author:   cmpilato at gmail.com
Date:     Tue Aug  2 13:03:22 2011
Log:      * src/en/book/ch06-server-configuration.xml
   (): Minor tweaks, include a mention of launchd as an option for
     launching svnserve.
   (svn.serverconfig.svnserve.invoking.launchd): New section.

Patch by: Quinn Taylor <quinntaylor at mac.com>
           (Tweaked by me.)

http://code.google.com/p/svnbook/source/detail?r=3945

Modified:
  /trunk/src/en/book/ch06-server-configuration.xml

=======================================
--- /trunk/src/en/book/ch06-server-configuration.xml	Wed Jul 27 11:54:31  
2011
+++ /trunk/src/en/book/ch06-server-configuration.xml	Tue Aug  2 13:03:22  
2011
@@ -466,6 +466,8 @@
              tunnel.</para></listitem>
          <listitem><para>Run <command>svnserve</command> as a Microsoft
              Windows service.</para></listitem>
+        <listitem><para>Run <command>svnserve</command> as a launchd
+            job.</para></listitem>
        </itemizedlist>

        <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
-->
@@ -586,7 +588,7 @@
        <sect3 id="svn.serverconfig.svnserve.invoking.tunnel">
          <title>svnserve over a tunnel</title>

-        <para>A third way to invoke <command>svnserve</command> is in
+        <para>Another way to invoke <command>svnserve</command> is in
            tunnel mode, using the <option>-t</option> option.  This
            mode assumes that a remote-service program such as
            <command>rsh</command> or <command>ssh</command> has
@@ -615,7 +617,7 @@

        <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
-->
        <sect3 id="svn.serverconfig.svnserve.invoking.winservice">
-        <title>svnserve as Windows service</title>
+        <title>svnserve as a Windows service</title>

          <para>If your Windows system is a descendant of Windows NT
            (2000, 2003, XP, or Vista), you can
@@ -711,6 +713,125 @@

        </sect3>

+      <!-- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -  
-->
+      <sect3 id="svn.serverconfig.svnserve.invoking.launchd">
+        <title>svnserve as a launchd job</title>
+
+        <para>Mac OS X (10.4 and higher) uses <command>launchd</command>
+          to manage processes (including daemons) both system-wide and
+          per-user.  A <command>launchd</command> job is specified by
+          parameters in an XML property list file, and
+          the <command>launchctl</command> command is used to manage
+          the lifecycle of those jobs.</para>
+
+        <para>When configured to run as a <command>launchd</command>
+          job, <command>svnserve</command> is automatically launched
+          on demand whenever incoming Subversion
+          <literal>svn://</literal> network traffic needs to be
+          handled.  This is far more convenient than a configuration
+          which requires you to manually invoke
+          <command>svnserve</command> as a long-running
+          background process.</para>
+
+        <para>To configure <command>svnserve</command> as
+          a <command>launchd</command> job, first create a job
+          definition file.  See
+          <xref linkend="svn.serverconfig.svnserve.invoking.launchd.ex-1"/>
+          for a sample of such a file.</para>
+
+        <example id="svn.serverconfig.svnserve.invoking.launchd.ex-1">
+          <title>A sample svnserve launchd job definition</title>
+          <programlisting>
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN"
+    "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
+<plist version="1.0">
+    <dict>
+        <key>Label</key>
+        <string>org.tigris.subversion.svnserve</string>
+        <key>ServiceDescription</key>
+        <string>Host Subversion repositories using svn://  
schema</string>
+        <key>ProgramArguments</key>
+        <array>
+            <string>/usr/bin/svnserve</string>
+            <string>--inetd</string>
+            <string>--root=/var/svn</string>
+        </array>
+        <key>UserName</key>
+        <string>svn</string>
+        <key>GroupName</key>
+        <string>svn</string>
+        <key>inetdCompatibility</key>
+        <dict>
+            <key>Wait</key>
+            <false/>
+        </dict>
+        <key>Sockets</key>
+        <dict>
+            <key>Listeners</key>
+            <array>
+                <dict>
+                    <key>SockServiceName</key>
+                    <string>svn</string>
+                    <key>Bonjour</key>
+                    <true/>
+                </dict>
+            </array>
+        </dict>
+    </dict>
+</plist>
+</programlisting>
+        </example>
+
+        <para>In the examples which follow, we'll assume that
+          our <command>launchd</command> job definition file has been
+          created at
+           
<filename>/Library/LaunchDaemons/org.tigris.subversion.svnserve.plist</filename>.</para>
+
+        <para>Once your job definition file is created, you can
+          activate the job using the <command>launchctl load</command>
+          command:</para>
+
+        <informalexample>
+          <screen>
+$ sudo launchctl load \
+       -w /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist
+</screen>
+        </informalexample>
+
+        <note>
+          <para>Because we want <command>svnserve</command> to be a
+            system-wide daemon process, we need to
+            use <command>sudo</command> to manage this job as an
+            administrator.  Note also that the
+            <literal>UserName</literal>
+            and <literal>GroupName</literal> keys in the definition
+            file are optional—if omitted, the job will run as
+            the user who loaded the job.</para>
+        </note>
+
+        <para>Deactivating the job is just as using—use
+          the <command>launchctl unload</command> command:</para>
+
+        <informalexample>
+          <screen>
+$ sudo launchctl unload \
+       -w /Library/LaunchDaemons/org.tigris.subversion.svnserve.plist
+</screen>
+        </informalexample>
+
+        <para><command>launchctl</command> also provides a way for you
+          to query the status of jobs:</para>
+
+        <!-- ### FIXME:  What is the output of this command when the
+             ###         grep matches? -->
+        <informalexample>
+          <screen>
+$ sudo launchctl list | grep org.tigris.subversion.svnserve
+</screen>
+        </informalexample>
+
+      </sect3>
      </sect2>

      <!-- ===============================================================  
-->




More information about the svnbook-dev mailing list