From 145ab5c89a626f9ef0c289bdf6b83826339e482a Mon Sep 17 00:00:00 2001 From: Sandro Santilli Date: Mon, 7 Nov 2016 12:54:17 +0100 Subject: [PATCH] Rename and update init files to use "gitea" instead of "gogs" Closes #102 --- scripts/init/centos/{gogs => gitea} | 18 +++---- scripts/init/debian/{gogs => gitea} | 6 +-- scripts/init/freebsd/gitea | 47 +++++++++++++++++++ scripts/init/freebsd/gogs | 47 ------------------- scripts/init/openbsd/gitea | 19 ++++++++ scripts/init/openbsd/gogs | 19 -------- scripts/init/suse/{gogs => gitea} | 18 +++---- .../{io.gogs.web.plist => io.gitea.web.plist} | 14 +++--- scripts/supervisor/{gogs => gitea} | 8 ++-- .../systemd/{gogs.service => gitea.service} | 4 +- 10 files changed, 100 insertions(+), 100 deletions(-) rename scripts/init/centos/{gogs => gitea} (83%) rename scripts/init/debian/{gogs => gitea} (97%) create mode 100644 scripts/init/freebsd/gitea delete mode 100644 scripts/init/freebsd/gogs create mode 100755 scripts/init/openbsd/gitea delete mode 100755 scripts/init/openbsd/gogs rename scripts/init/suse/{gogs => gitea} (88%) rename scripts/launchd/{io.gogs.web.plist => io.gitea.web.plist} (73%) rename scripts/supervisor/{gogs => gitea} (57%) rename scripts/systemd/{gogs.service => gitea.service} (87%) diff --git a/scripts/init/centos/gogs b/scripts/init/centos/gitea similarity index 83% rename from scripts/init/centos/gogs rename to scripts/init/centos/gitea index 1a9fc2772..77c720271 100644 --- a/scripts/init/centos/gogs +++ b/scripts/init/centos/gitea @@ -1,6 +1,6 @@ #!/bin/sh # -# /etc/rc.d/init.d/gogs +# /etc/rc.d/init.d/gitea # # Runs the Gogs Go Git Service. # @@ -9,13 +9,13 @@ # ### BEGIN INIT INFO -# Provides: gogs +# Provides: gitea # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Start gogs at boot time. -# Description: Control gogs. +# Short-Description: Start gitea at boot time. +# Description: Control gitea. ### END INIT INFO # Source function library. @@ -23,17 +23,17 @@ # Default values -NAME=gogs -GITEA_HOME=/home/git/gogs +NAME=gitea +GITEA_HOME=/home/git/gitea GITEA_PATH=${GITEA_HOME}/$NAME GITEA_USER=git SERVICENAME="Gogs Go Git Service" -LOCKFILE=/var/lock/subsys/gogs +LOCKFILE=/var/lock/subsys/gitea LOGPATH=${GITEA_HOME}/log -LOGFILE=${LOGPATH}/gogs.log +LOGFILE=${LOGPATH}/gitea.log RETVAL=0 -# Read configuration from /etc/sysconfig/gogs to override defaults +# Read configuration from /etc/sysconfig/gitea to override defaults [ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME # Don't do anything if nothing is installed diff --git a/scripts/init/debian/gogs b/scripts/init/debian/gitea similarity index 97% rename from scripts/init/debian/gogs rename to scripts/init/debian/gitea index 187e23a96..f822edf5a 100644 --- a/scripts/init/debian/gogs +++ b/scripts/init/debian/gitea @@ -1,6 +1,6 @@ #! /bin/sh ### BEGIN INIT INFO -# Provides: gogs +# Provides: gitea # Required-Start: $syslog $network # Required-Stop: $syslog # Default-Start: 2 3 4 5 @@ -16,11 +16,11 @@ # PATH should only include /usr/* if it runs after the mountnfs.sh script PATH=/sbin:/usr/sbin:/bin:/usr/bin DESC="Go Git Service" -NAME=gogs +NAME=gitea SERVICEVERBOSE=yes PIDFILE=/var/run/$NAME.pid SCRIPTNAME=/etc/init.d/$NAME -WORKINGDIR=/home/git/gogs +WORKINGDIR=/home/git/gitea DAEMON=$WORKINGDIR/$NAME DAEMON_ARGS="web" USER=git diff --git a/scripts/init/freebsd/gitea b/scripts/init/freebsd/gitea new file mode 100644 index 000000000..898606f35 --- /dev/null +++ b/scripts/init/freebsd/gitea @@ -0,0 +1,47 @@ +#!/bin/sh +# +# $FreeBSD$ +# +# PROVIDE: gitea +# REQUIRE: NETWORKING SYSLOG +# KEYWORD: shutdown +# +# Add the following lines to /etc/rc.conf to enable gitea: +# +#gitea_enable="YES" + +. /etc/rc.subr + +name="gitea" +rcvar="gitea_enable" + +load_rc_config $name + +: ${gitea_user:="git"} +: ${gitea_enable:="NO"} +: ${gitea_directory:="/home/git"} + +command="${gitea_directory}/gitea web" +procname="$(echo $command |cut -d' ' -f1)" + +pidfile="${gitea_directory}/${name}.pid" + +start_cmd="${name}_start" +stop_cmd="${name}_stop" + +gitea_start() { + cd ${gitea_directory} + export USER=${gitea_user} + export HOME=/usr/home/${gitea_user} + /usr/sbin/daemon -f -u ${gitea_user} -p ${pidfile} $command +} + +gitea_stop() { + if [ ! -f $pidfile ]; then + echo "GITEA PID File not found. Maybe GITEA is not running?" + else + kill $(cat $pidfile) + fi +} + +run_rc_command "$1" diff --git a/scripts/init/freebsd/gogs b/scripts/init/freebsd/gogs deleted file mode 100644 index 8fc0359ef..000000000 --- a/scripts/init/freebsd/gogs +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh -# -# $FreeBSD$ -# -# PROVIDE: gogs -# REQUIRE: NETWORKING SYSLOG -# KEYWORD: shutdown -# -# Add the following lines to /etc/rc.conf to enable gogs: -# -#gogs_enable="YES" - -. /etc/rc.subr - -name="gogs" -rcvar="gogs_enable" - -load_rc_config $name - -: ${gogs_user:="git"} -: ${gogs_enable:="NO"} -: ${gogs_directory:="/home/git"} - -command="${gogs_directory}/gogs web" -procname="$(echo $command |cut -d' ' -f1)" - -pidfile="${gogs_directory}/${name}.pid" - -start_cmd="${name}_start" -stop_cmd="${name}_stop" - -gogs_start() { - cd ${gogs_directory} - export USER=${gogs_user} - export HOME=/usr/home/${gogs_user} - /usr/sbin/daemon -f -u ${gogs_user} -p ${pidfile} $command -} - -gogs_stop() { - if [ ! -f $pidfile ]; then - echo "GITEA PID File not found. Maybe GITEA is not running?" - else - kill $(cat $pidfile) - fi -} - -run_rc_command "$1" diff --git a/scripts/init/openbsd/gitea b/scripts/init/openbsd/gitea new file mode 100755 index 000000000..c43190b55 --- /dev/null +++ b/scripts/init/openbsd/gitea @@ -0,0 +1,19 @@ +#!/bin/sh +# +# $OpenBSD$ + +daemon="/home/git/gitea/gitea" +daemon_user="git" +daemon_flags="web" + +gitea_directory="/home/git/gitea" + +rc_bg=YES + +. /etc/rc.d/rc.subr + +rc_start() { + ${rcexec} "cd ${gitea_directory}; ${daemon} ${daemon_flags} ${_bg}" +} + +rc_cmd $1 diff --git a/scripts/init/openbsd/gogs b/scripts/init/openbsd/gogs deleted file mode 100755 index 95fcf1696..000000000 --- a/scripts/init/openbsd/gogs +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -# -# $OpenBSD$ - -daemon="/home/git/gogs/gogs" -daemon_user="git" -daemon_flags="web" - -gogs_directory="/home/git/gogs" - -rc_bg=YES - -. /etc/rc.d/rc.subr - -rc_start() { - ${rcexec} "cd ${gogs_directory}; ${daemon} ${daemon_flags} ${_bg}" -} - -rc_cmd $1 diff --git a/scripts/init/suse/gogs b/scripts/init/suse/gitea similarity index 88% rename from scripts/init/suse/gogs rename to scripts/init/suse/gitea index da5f79580..7f7d675aa 100644 --- a/scripts/init/suse/gogs +++ b/scripts/init/suse/gitea @@ -1,34 +1,34 @@ #!/bin/sh # -# /etc/init.d/gogs +# /etc/init.d/gitea # # Runs the Gogs Go Git Service. # ### BEGIN INIT INFO -# Provides: gogs +# Provides: gitea # Required-Start: $remote_fs # Required-Stop: $remote_fs # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 -# Short-Description: Start gogs at boot time. -# Description: Control gogs. +# Short-Description: Start gitea at boot time. +# Description: Control gitea. ### END INIT INFO # Default values -NAME=gogs -GITEA_HOME=/home/git/gogs +NAME=gitea +GITEA_HOME=/home/git/gitea GITEA_PATH=${GITEA_HOME}/$NAME GITEA_USER=git SERVICENAME="Go Git Service" -LOCKFILE=/var/lock/subsys/gogs +LOCKFILE=/var/lock/subsys/gitea LOGPATH=${GITEA_HOME}/log LOGFILE=${LOGPATH}/error.log -# gogs creates its own gogs.log from stdout +# gitea creates its own gitea.log from stdout RETVAL=0 -# Read configuration from /etc/sysconfig/gogs to override defaults +# Read configuration from /etc/sysconfig/gitea to override defaults [ -r /etc/sysconfig/$NAME ] && . /etc/sysconfig/$NAME # Don't do anything if nothing is installed diff --git a/scripts/launchd/io.gogs.web.plist b/scripts/launchd/io.gitea.web.plist similarity index 73% rename from scripts/launchd/io.gogs.web.plist rename to scripts/launchd/io.gitea.web.plist index 2a5ec7d69..6181ea15c 100644 --- a/scripts/launchd/io.gogs.web.plist +++ b/scripts/launchd/io.gitea.web.plist @@ -3,7 +3,7 @@ Label - io.gogs.web + io.gitea.web UserName @@ -12,23 +12,23 @@ git ProgramArguments - + - /Users/git/gogs/gogs + /Users/git/gitea/gitea web RunAtLoad KeepAlive - + WorkingDirectory - /Users/git/gogs/ + /Users/git/gitea/ StandardOutPath - /Users/git/gogs/log/stdout.log + /Users/git/gitea/log/stdout.log StandardErrorPath - /Users/git/gogs/log/stderr.log + /Users/git/gitea/log/stderr.log SoftResourceLimits diff --git a/scripts/supervisor/gogs b/scripts/supervisor/gitea similarity index 57% rename from scripts/supervisor/gogs rename to scripts/supervisor/gitea index 39323521a..a8a908d50 100644 --- a/scripts/supervisor/gogs +++ b/scripts/supervisor/gitea @@ -1,14 +1,14 @@ -[program:gogs] +[program:gitea] directory=/home/git/go/src/github.com/go-gitea/gitea/ -command=/home/git/go/src/github.com/go-gitea/gitea/gogs web +command=/home/git/go/src/github.com/go-gitea/gitea/gitea web autostart=true autorestart=true startsecs=10 -stdout_logfile=/var/log/gogs/stdout.log +stdout_logfile=/var/log/gitea/stdout.log stdout_logfile_maxbytes=1MB stdout_logfile_backups=10 stdout_capture_maxbytes=1MB -stderr_logfile=/var/log/gogs/stderr.log +stderr_logfile=/var/log/gitea/stderr.log stderr_logfile_maxbytes=1MB stderr_logfile_backups=10 stderr_capture_maxbytes=1MB diff --git a/scripts/systemd/gogs.service b/scripts/systemd/gitea.service similarity index 87% rename from scripts/systemd/gogs.service rename to scripts/systemd/gitea.service index e0db5ecbc..48ef7322f 100644 --- a/scripts/systemd/gogs.service +++ b/scripts/systemd/gitea.service @@ -17,8 +17,8 @@ After=network.target Type=simple User=git Group=git -WorkingDirectory=/home/git/gogs -ExecStart=/home/git/gogs/gogs web +WorkingDirectory=/home/git/gitea +ExecStart=/home/git/gitea/gitea web Restart=always Environment=USER=git HOME=/home/git