diff options
author | Björn <bo@kbct.de> | 2015-05-13 14:15:05 +0200 |
---|---|---|
committer | Björn <bo@kbct.de> | 2015-06-04 13:15:00 +0200 |
commit | 6eecbf17cd8be6c2ee7f935e53a45c4f41f86d04 (patch) | |
tree | 97997e4f4bf1fc474a488fb4f3b6b4411b9b41a4 /scripts | |
parent | 06476459482cfdcb52cbee65d204d92d0ba3844d (diff) | |
download | gitea-6eecbf17cd8be6c2ee7f935e53a45c4f41f86d04.tar.gz gitea-6eecbf17cd8be6c2ee7f935e53a45c4f41f86d04.zip |
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
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/init/debian/gogs | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/scripts/init/debian/gogs b/scripts/init/debian/gogs index 13e8b8aa5b..b0b52286fc 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" } |