ソースを参照

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
tags/v0.9.99
Björn 9年前
コミット
6eecbf17cd
1個のファイルの変更4行の追加2行の削除
  1. 4
    2
      scripts/init/debian/gogs

+ 4
- 2
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"
}


読み込み中…
キャンセル
保存