Changeset 5362771


Ignore:
Timestamp:
01/05/2021 03:59:46 PM (9 months ago)
Author:
Thomas Trepl <thomas@…>
Branches:
10.1, 11.0, lazarus, qt5new, trunk, xry111/git-date, xry111/git-date-for-trunk, xry111/git-date-test
Children:
1ea3b96
Parents:
9ade54a3
Message:

Update gitserver page, add bootscript (sysv/systemd)

git-svn-id: svn://svn.linuxfromscratch.org/BLFS/trunk/BOOK@24071 af4574ff-66df-0310-9fd7-8a98e5e911e0

Files:
4 edited

Legend:

Unmodified
Added
Removed
  • general.ent

    r9ade54a3 r5362771  
    11<!-- $LastChangedBy$ $Date$ -->
    22
    3 <!ENTITY day          "04">                   <!-- Always 2 digits -->
     3<!ENTITY day          "05">                   <!-- Always 2 digits -->
    44<!ENTITY month        "01">                   <!-- Always 2 digits -->
    55<!ENTITY year         "2021">
     
    77<!ENTITY copyholder   "The BLFS Development Team">
    88<!ENTITY version      "&year;-&month;-&day;">
    9 <!ENTITY releasedate  "January 4th, &year;">
     9<!ENTITY releasedate  "January 5th, &year;">
    1010<!ENTITY pubdate      "&year;-&month;-&day;"> <!-- metadata req. by TLDP -->
    1111<!ENTITY blfs-version "svn">                  <!-- svn|[release #] -->
  • general/prog/gitserver.xml

    r9ade54a3 r5362771  
    194194      </para>
    195195      <para>
    196         The compination of access via ssh (for authenticated users) and
     196        The combination of access via ssh (for authenticated users) and
    197197        the export of repositories to unauthenticated users via the
    198198        daemon is in most cases enough for a development site.
     
    207207      </note>
    208208
    209       <para>
    210         As user <systemitem class='username'>root</systemitem> do:
    211       </para>
    212 
    213 <screen role="root" revision="sysv"><userinput>cat &gt; /etc/rc.d/init.d/git-daemon &lt;&lt;"EOF"
    214 #!/bin/sh
    215 ########################################################################
    216 # Begin /etc/rc.d/init.d/git-daemon
    217 #
    218 # Description : Start/Stop git as a daemon
    219 #
    220 # Authors     :
    221 #
    222 # Version     : LFS x.x
    223 #
    224 # Notes       :
    225 #
    226 ########################################################################
    227 
    228 ### BEGIN INIT INFO
    229 # Provides:            git-daemon
    230 # Required-Start:      network
    231 # Should-Start:
    232 # Required-Stop:
    233 # Should-Stop:
    234 # Default-Start:
    235 # Default-Stop:
    236 # Short-Description:   git as daemon
    237 # Description:
    238 # X-LFS-Provided-By:
    239 ### END INIT INFO
    240 
    241 . /lib/lsb/init-functions
    242 
    243 GIT_BIN="/usr/bin/git"
    244 DFT_REPO_DIR="/srv/git/"
    245 PID_FILE="/run/git-daemon.pid"
    246 
    247 case "${1}" in
    248    start)
    249       log_info_msg "Starting git-daemon ..."
    250       $GIT_BIN daemon \
    251                --detach --pid-file=$PID_FILE \
    252                --user=git --group=git \
    253                --reuseaddr --base-path=$DFT_REPO_DIR $DFT_REPO_DIR
    254       evaluate_retval
    255       ;;
    256 
    257    stop)
    258       log_info_msg "Stopping git-daemon ..."
    259       killproc -p $PID_FILE $GIT_BIN
    260       evaluate_retval
    261       ;;
    262 
    263    restart)
    264       ${0} stop
    265       sleep 1
    266       ${0} start
    267       ;;
    268 
    269    *)
    270       echo "Usage: ${0} {start|stop|restart}"
    271       exit 1
    272       ;;
    273 esac
    274 
    275 exit 0
    276 
    277 # End /etc/rc.d/init.d/git-daemon
    278 EOF
    279 chmod 755 /etc/rc.d/init.d/git-daemon
    280 ln -v -sf ../init.d/git-daemon /etc/rc.d/rc0.d/K29git-daemon
    281 ln -v -sf ../init.d/git-daemon /etc/rc.d/rc1.d/K29git-daemon
    282 ln -v -sf ../init.d/git-daemon /etc/rc.d/rc2.d/K29git-daemon
    283 ln -v -sf ../init.d/git-daemon /etc/rc.d/rc3.d/S50git-daemon
    284 ln -v -sf ../init.d/git-daemon /etc/rc.d/rc4.d/S50git-daemon
    285 ln -v -sf ../init.d/git-daemon /etc/rc.d/rc5.d/S50git-daemon
    286 ln -v -sf ../init.d/git-daemon /etc/rc.d/rc6.d/K29git-daemon</userinput></screen>
    287 
    288 <screen role="root" revision="systemd"><userinput>cat &gt; /etc/systemd/system/git-daemon.service &lt;&lt;EOF
    289 [Unit]
    290 Description=Start Git Daemon
    291 
    292 [Service]
    293 ExecStart=/usr/bin/git daemon --reuseaddr --base-path=/srv/git/ /srv/git/
    294 
    295 Restart=always
    296 RestartSec=500ms
    297 
    298 StandardOutput=syslog
    299 StandardError=syslog
    300 SyslogIdentifier=git-daemon
    301 
    302 User=git
    303 Group=git
    304 
    305 [Install]
    306 WantedBy=multi-user.target
    307 EOF</userinput></screen>
     209    </sect3>
     210   
     211    <sect3 id="gitserver-init">
     212      <title>4. Starting the Server</title>
     213
     214      <para revision="sysv">
     215        To start the server at boot time, install the git-daemon
     216        bootscript included in the <xref linkend="bootscripts"/> package:
     217      </para>
     218
    308219      <para revision="systemd">
    309         Enable and start the daemon be executing
    310       </para>
    311 <screen role="root" revision="systemd"><userinput>systemctl enable git-daemon &amp;&amp;
    312 systemctl start git-daemon</userinput></screen>
    313       <para revision="sysv">
    314         Start the daemon be executing
    315       </para>
    316 <screen role="root" revision="sysv"><userinput>/etc/rc.d/init.d/git-daemon start</userinput></screen>
    317      
     220        To start the server at boot time, install the
     221        <filename>git-daemon.service</filename> unit from the
     222        <xref linkend="systemd-units"/> package:
     223      </para>
     224
     225      <indexterm zone="gitserver gitserver-init" revision="sysv">
     226        <primary sortas="f-git">git</primary>
     227      </indexterm>
     228
     229<screen role="root" revision="sysv"><userinput>make install-git-daemon</userinput></screen>
     230
     231      <indexterm zone="gitserver gitserver-init" revision="systemd">
     232        <primary sortas="f-gitserve">gitserve</primary>
     233      </indexterm>
     234
     235<screen role="root" revision="systemd"><userinput>make install-git-daemon</userinput></screen>
     236
    318237      <para>
    319238        In order to make <application>git</application> exporting a
     
    326245<screen role="root"><userinput>touch /srv/git/project1.git/git-daemon-export-ok</userinput></screen>
    327246
     247      <para>
     248        Also review the configuration file
     249        <filename revision="sysv">/etc/sysconfig/git-daemon</filename>
     250        <filename revision="systemd">/etc/default/git-daemon</filename>
     251        for valid repository paths.
     252      </para>
     253     
    328254    </sect3>
    329255
  • introduction/welcome/changelog.xml

    r9ade54a3 r5362771  
    4343    -->
    4444    <listitem>
     45      <para>January 5th, 2021</para>
     46      <itemizedlist>
     47        <listitem>
     48          <para>[thomas] - Add "Running a git Server" page.</para>
     49        </listitem>
     50      </itemizedlist>
     51    </listitem>
     52
     53    <listitem>
    4554      <para>January 4th, 2021</para>
    4655      <itemizedlist>
  • postlfs/config/users.xml

    r9ade54a3 r5362771  
    115115        <row><entry>svn     </entry><entry>56</entry><entry>56</entry></row>
    116116        <row><entry>svntest </entry><entry>  </entry><entry>57</entry></row>
     117        <row><entry>git     </entry><entry>58</entry><entry>58</entry></row>
    117118        <!-- <row><entry>pulse   </entry><entry>58</entry><entry>58</entry></row>
    118119        <row><entry>pulse-access</entry><entry></entry><entry>59</entry></row>
Note: See TracChangeset for help on using the changeset viewer.