code.gitea.io/gitea@v1.21.7/contrib/init/openwrt/gitea (about) 1 #!/bin/sh /etc/rc.common 2 3 USE_PROCD=1 4 5 # PROCD_DEBUG=1 6 7 START=90 8 STOP=10 9 10 PROG=/opt/gitea/gitea 11 GITEA_WORK_DIR=/opt/gitea 12 CONF_FILE=$GITEA_WORK_DIR/app.ini 13 14 start_service(){ 15 procd_open_instance gitea 16 procd_set_param env GITEA_WORK_DIR=$GITEA_WORK_DIR 17 procd_set_param env HOME=$GITEA_WORK_DIR 18 procd_set_param command $PROG web -c $CONF_FILE 19 procd_set_param file $CONF_FILE 20 procd_set_param user git 21 procd_set_param respawn ${respawn_threshold:-3600} ${respawn_timeout:-5} ${respawn_retry:-5} # respawn automatically if something died, be careful if you have an alternative process supervisor 22 procd_close_instance 23 } 24 25 start(){ 26 service_start $PROG 27 } 28 29 stop(){ 30 service_stop $PROG 31 } 32 33 reload(){ 34 service_reload $PROG 35 }