code.gitea.io/gitea@v1.21.7/contrib/init/gentoo/gitea (about)

     1  #!/sbin/openrc-run
     2  
     3  DIR=/var/lib/gitea
     4  USER=git
     5  HOME=/home/${USER}
     6  GITEA_WORK_DIR=${DIR}
     7  EXECUTABLE=/usr/local/bin/gitea
     8  
     9  export USER
    10  export HOME
    11  export GITEA_WORK_DIR
    12  
    13  name=$RC_SVCNAME
    14  cfgfile="/etc/$RC_SVCNAME/app.ini"
    15  command="${EXECUTABLE}"
    16  command_user="${USER}"
    17  command_args="web -c /etc/$RC_SVCNAME/app.ini"
    18  command_background="yes"
    19  pidfile="/run/$RC_SVCNAME/$RC_SVCNAME.pid"
    20  start_stop_daemon_args="--user ${USER} --chdir ${DIR}"
    21  
    22  depend()
    23  {
    24      need net
    25      ###
    26      # Don't forget to add the database service requirements
    27      ###
    28      #after postgresql
    29      #after mysql
    30      #after mariadb
    31      #after memcached
    32      #after redis
    33  }
    34  
    35  start_pre()
    36  {
    37          checkpath --directory --owner $command_user:$command_user --mode 0750 \
    38                  /run/$RC_SVCNAME /var/log/$RC_SVCNAME
    39          ##
    40          # If you want to bind Gitea to a port below 1024, uncomment
    41          # the value below
    42          ##
    43          #setcap cap_net_bind_service=+ep "${EXECUTABLE}"
    44  }