diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/init/centos/gogs | 5 | ||||
-rw-r--r-- | scripts/init/freebsd/gogs | 2 | ||||
-rw-r--r-- | scripts/windows/install-as-service.bat | 25 |
3 files changed, 30 insertions, 2 deletions
diff --git a/scripts/init/centos/gogs b/scripts/init/centos/gogs index 5ff6de53..cacf5742 100644 --- a/scripts/init/centos/gogs +++ b/scripts/init/centos/gogs @@ -29,7 +29,8 @@ GOGS_PATH=${GOGS_HOME}/$NAME GOGS_USER=git SERVICENAME="Gogs Go Git Service" LOCKFILE=/var/lock/subsys/gogs -LOGFILE=${GOGS_HOME}/log/gogs.log +LOGPATH=${GOGS_HOME}/log +LOGFILE=${LOGPATH}/gogs.log RETVAL=0 # Read configuration from /etc/sysconfig/gogs to override defaults @@ -37,6 +38,8 @@ RETVAL=0 # Don't do anything if nothing is installed [ -x ${GOGS_PATH} ] || exit 0 +# exit if logpath dir is not created. +[ -x ${LOGPATH} ] || exit 0 DAEMON_OPTS="--check $NAME" diff --git a/scripts/init/freebsd/gogs b/scripts/init/freebsd/gogs index e1d3bdee..42258c40 100644 --- a/scripts/init/freebsd/gogs +++ b/scripts/init/freebsd/gogs @@ -31,7 +31,7 @@ stop_cmd="${name}_stop" gogs_start() { cd ${gogs_directory} export USER=${gogs_user} - export HOME=${gogs_directory} + export HOME=/usr/home/${gogs_user} /usr/sbin/daemon -f -u ${gogs_user} -p ${pidfile} $command } diff --git a/scripts/windows/install-as-service.bat b/scripts/windows/install-as-service.bat new file mode 100644 index 00000000..e5d59826 --- /dev/null +++ b/scripts/windows/install-as-service.bat @@ -0,0 +1,25 @@ +@ECHO off + +:: This script relies on nssm.exe to work. +:: Please, download it and make it available on the system path, +:: or copy it to the gogs path. +:: https://nssm.cc/download +:: This script itself should run in the gogs path, too. +:: In case of startup failure, please read carefully the log file. +:: Make sure Gogs work running manually with "gogs web" before running +:: this script. +:: And, please, read carefully the installation docs first: +:: http://gogs.io/docs/installation +:: To unistall the service, run "nssm remove gogs" and restart Windows. + +:: Set the folder where you extracted Gogs. Omit the last slash. +SET gogspath=C:\gogs + +nssm install gogs "%gogspath%\gogs.exe" +nssm set gogs AppParameters "web" +nssm set gogs Description "A painless self-hosted Git service." +nssm set gogs DisplayName "Gogs - Go Git Service" +nssm set gogs Start SERVICE_DELAYED_AUTO_START +nssm set gogs AppStdout "%gogspath%\gogs.log" +nssm start gogs +pause |