diff --git a/scripts/gogs_supervisord.sh b/scripts/gogs_supervisord.sh index 016675848..f2e376ed7 100755 --- a/scripts/gogs_supervisord.sh +++ b/scripts/gogs_supervisord.sh @@ -7,7 +7,7 @@ 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 + sudo ln -s $gogs_scripts_path'/start_for_supervisord.sh' /usr/bin/gogs_start fi LOGDIR="log" diff --git a/scripts/start_for_supervisord.sh b/scripts/start_for_supervisord.sh new file mode 100755 index 000000000..2c95c0a8a --- /dev/null +++ b/scripts/start_for_supervisord.sh @@ -0,0 +1,9 @@ +#!/bin/sh +IFS=' + ' +PATH=/bin:/usr/bin:/usr/local/bin +USER=$(whoami) +HOME=$(grep "^$USER:" /etc/passwd | cut -d: -f6) +export USER HOME PATH + +cd "$HOME/gogs" && exec ./gogs web \ No newline at end of file