code.gitea.io/gitea@v1.22.3/contrib/systemd/gitea.service (about)

     1  [Unit]
     2  Description=Gitea (Git with a cup of tea)
     3  After=network.target
     4  ###
     5  # Don't forget to add the database service dependencies
     6  ###
     7  #
     8  #Wants=mysql.service
     9  #After=mysql.service
    10  #
    11  #Wants=mariadb.service
    12  #After=mariadb.service
    13  #
    14  #Wants=postgresql.service
    15  #After=postgresql.service
    16  #
    17  #Wants=memcached.service
    18  #After=memcached.service
    19  #
    20  #Wants=redis.service
    21  #After=redis.service
    22  #
    23  ###
    24  # If using socket activation for main http/s
    25  ###
    26  #
    27  #After=gitea.main.socket
    28  #Requires=gitea.main.socket
    29  #
    30  ###
    31  # (You can also provide gitea an http fallback and/or ssh socket too)
    32  #
    33  # An example of /etc/systemd/system/gitea.main.socket
    34  ###
    35  ##
    36  ## [Unit]
    37  ## Description=Gitea Web Socket
    38  ## PartOf=gitea.service
    39  ##
    40  ## [Socket]
    41  ## Service=gitea.service
    42  ## ListenStream=<some_port>
    43  ## NoDelay=true
    44  ##
    45  ## [Install]
    46  ## WantedBy=sockets.target
    47  ##
    48  ###
    49  
    50  [Service]
    51  # Uncomment the next line if you have repos with lots of files and get a HTTP 500 error because of that
    52  # LimitNOFILE=524288:524288
    53  RestartSec=2s
    54  Type=simple
    55  User=git
    56  Group=git
    57  WorkingDirectory=/var/lib/gitea/
    58  # If using Unix socket: tells systemd to create the /run/gitea folder, which will contain the gitea.sock file
    59  # (manually creating /run/gitea doesn't work, because it would not persist across reboots)
    60  #RuntimeDirectory=gitea
    61  ExecStart=/usr/local/bin/gitea web --config /etc/gitea/app.ini
    62  Restart=always
    63  Environment=USER=git HOME=/home/git GITEA_WORK_DIR=/var/lib/gitea
    64  # If you install Git to directory prefix other than default PATH (which happens
    65  # for example if you install other versions of Git side-to-side with
    66  # distribution version), uncomment below line and add that prefix to PATH
    67  # Don't forget to place git-lfs binary on the PATH below if you want to enable
    68  # Git LFS support
    69  #Environment=PATH=/path/to/git/bin:/bin:/sbin:/usr/bin:/usr/sbin
    70  # If you want to bind Gitea to a port below 1024, uncomment
    71  # the two values below, or use socket activation to pass Gitea its ports as above
    72  ###
    73  #CapabilityBoundingSet=CAP_NET_BIND_SERVICE
    74  #AmbientCapabilities=CAP_NET_BIND_SERVICE
    75  ###
    76  # In some cases, when using CapabilityBoundingSet and AmbientCapabilities option, you may want to
    77  # set the following value to false to allow capabilities to be applied on gitea process. The following
    78  # value if set to true sandboxes gitea service and prevent any processes from running with privileges
    79  # in the host user namespace.
    80  ###
    81  #PrivateUsers=false
    82  ###
    83  
    84  [Install]
    85  WantedBy=multi-user.target