From 66d7adc3a8027177bb576190e288ae8b5e6173c2 Mon Sep 17 00:00:00 2001 From: Martin van Beurden <chadoe@gmail.com> Date: Sat, 9 May 2015 20:24:33 +0200 Subject: fix systemd "Trailing garbage, ignoring." warning. Environment should be a space-separated list instead of comma-separated. No need for double quoting when the values don't contain spaces. --- scripts/systemd/gogs.service | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/systemd/gogs.service b/scripts/systemd/gogs.service index 7436e46a..95567eaa 100644 --- a/scripts/systemd/gogs.service +++ b/scripts/systemd/gogs.service @@ -14,7 +14,7 @@ Group=git WorkingDirectory=/home/git/gogs ExecStart=/home/git/gogs/gogs web Restart=always -Environment="USER=git","HOME=/home/git" +Environment=USER=git HOME=/home/git [Install] WantedBy=multi-user.target -- cgit v1.2.3 From 6eecbf17cd8be6c2ee7f935e53a45c4f41f86d04 Mon Sep 17 00:00:00 2001 From: Björn <bo@kbct.de> Date: Wed, 13 May 2015 14:15:05 +0200 Subject: fix debian init script - use start-stop-daemon's chuid feature insted of su - using `su -c` breaks if the git user has no usable shell - this fixes #1025 - put --test before --exec, instead it gets passed to gogs - set cwd via --chdir --- scripts/init/debian/gogs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/init/debian/gogs b/scripts/init/debian/gogs index 13e8b8aa..b0b52286 100644 --- a/scripts/init/debian/gogs +++ b/scripts/init/debian/gogs @@ -49,10 +49,12 @@ do_start() # 1 if daemon was already running # 2 if daemon could not be started sh -c "start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \\ - --exec $DAEMON -- $DAEMON_ARGS --test > /dev/null \\ + --test --chdir $WORKINGDIR --chuid $USER \\ + --exec $DAEMON -- $DAEMON_ARGS > /dev/null \\ || return 1" sh -c "start-stop-daemon --start --quiet --pidfile $PIDFILE --make-pidfile \\ - --background --exec /bin/su -- - $USER -c \"cd \\\"$WORKINGDIR\\\" && $DAEMON -- $DAEMON_ARGS\" \\ + --background --chdir $WORKINGDIR --chuid $USER \\ + --exec $DAEMON -- $DAEMON_ARGS \\ || return 2" } -- cgit v1.2.3 From bfef8f0edd5f2c4afb1e2551a9e36c57508ad12d Mon Sep 17 00:00:00 2001 From: William Friesen <wfriesen@gmail.com> Date: Tue, 9 Jun 2015 21:40:43 +1000 Subject: Fix command used by FreeBSD init script --- scripts/init/freebsd/gogs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'scripts') diff --git a/scripts/init/freebsd/gogs b/scripts/init/freebsd/gogs index df13ee0d..e1d3bdee 100644 --- a/scripts/init/freebsd/gogs +++ b/scripts/init/freebsd/gogs @@ -21,7 +21,7 @@ load_rc_config $name : ${gogs_enable:="NO"} : ${gogs_directory:="/home/git"} -command="${gogs_directory}/scripts/start.sh" +command="${gogs_directory}/gogs web" pidfile="${gogs_directory}/${name}.pid" -- cgit v1.2.3 From 08f7547acf40c20eaaaaae3fdfc7835020d7d945 Mon Sep 17 00:00:00 2001 From: Linquize <linquize@yahoo.com.hk> Date: Sat, 4 Apr 2015 19:23:53 +0800 Subject: Update build.sh for Windows --- scripts/build.sh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'scripts') diff --git a/scripts/build.sh b/scripts/build.sh index ea43bdaf..cf127c2a 100755 --- a/scripts/build.sh +++ b/scripts/build.sh @@ -4,8 +4,14 @@ rm -rf $outPath mkdir $outPath go build ../gogs.go -chmod +x gogs -mv gogs $outPath/ +PLATFORM=`uname | cut -d _ -f 1` +if [ $PLATFORM = "MINGW32" ] || [ $PLATFORM = "MINGW64" ] || [ $PLATFORM = "CYGWIN" ]; then + GOGS_EXE=gogs.exe +else + GOGS_EXE=gogs +fi +chmod +x $GOGS_EXE +mv $GOGS_EXE $outPath/ cp -r ../conf/ $outPath/conf/ cp -r ../custom/ $outPath/custom/ -- cgit v1.2.3 From eda9211fa49ac3e5b8f2b772413abc7861fca0cd Mon Sep 17 00:00:00 2001 From: Unknwon <u@gogs.io> Date: Tue, 28 Jul 2015 15:30:14 +0800 Subject: fix #1198 --- scripts/gogs_supervisord.sh | 47 --------------------------------------------- scripts/supervisor/gogs | 16 +++++++++++++++ 2 files changed, 16 insertions(+), 47 deletions(-) delete mode 100755 scripts/gogs_supervisord.sh create mode 100644 scripts/supervisor/gogs (limited to 'scripts') diff --git a/scripts/gogs_supervisord.sh b/scripts/gogs_supervisord.sh deleted file mode 100755 index 01667584..00000000 --- a/scripts/gogs_supervisord.sh +++ /dev/null @@ -1,47 +0,0 @@ -#!/bin/sh - -PID="log/supervisord.pid" -CONF="etc/supervisord.conf" - -EXEPATH='/usr/bin/gogs_start' -if [ ! -f $EXEPATH ]; then - gogs_scripts_path=$(cd `dirname $0`; pwd) - echo $gogs_scripts_path - sudo ln -s $gogs_scripts_path'/start.sh' /usr/bin/gogs_start -fi - -LOGDIR="log" -if [ ! -d $LOGDIR ]; then - mkdir $LOGDIR -fi - -stop() { - if [ -f $PID ]; then - kill `cat -- $PID` - rm -f -- $PID - echo "stopped" - fi -} - -start() { - echo "starting" - if [ ! -f $PID ]; then - supervisord -c $CONF - echo "started" - fi -} - -case "$1" in - start) - start - ;; - stop) - stop - ;; - restart) - stop - start - ;; - *) - echo "Usage: $0 {start|stop|restart}" -esac \ No newline at end of file diff --git a/scripts/supervisor/gogs b/scripts/supervisor/gogs new file mode 100644 index 00000000..51531fb7 --- /dev/null +++ b/scripts/supervisor/gogs @@ -0,0 +1,16 @@ +[program:gogs] +directory=/home/git/go/src/github.com/gogits/gogs/ +command=/home/git/go/src/github.com/gogits/gogs/gogs web +autostart=true +autorestart=true +startsecs=10 +stdout_logfile=/var/log/gogs/stdout.log +stdout_logfile_maxbytes=1MB +stdout_logfile_backups=10 +stdout_capture_maxbytes=1MB +stderr_logfile=/var/log/gogs/stderr.log +stderr_logfile_maxbytes=1MB +stderr_logfile_backups=10 +stderr_capture_maxbytes=1MB +user = git +environment = HOME="/home/git", USER="git" \ No newline at end of file -- cgit v1.2.3