aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author无闻 <u@gogs.io>2015-07-25 00:42:29 +0800
committer无闻 <u@gogs.io>2015-07-25 00:42:29 +0800
commitfcd6b451927d4f29e8caad9df0fd60d3e281fc1d (patch)
tree9438cecf0bb0aa72a1d40f5ba878d4c6b6cded58
parent04e596f984ae53cf9b933920a2a7f9b0e8c7a881 (diff)
parent6eecbf17cd8be6c2ee7f935e53a45c4f41f86d04 (diff)
Merge pull request #1274 from Knorkebrot/master
fix debian init script
-rw-r--r--scripts/init/debian/gogs6
1 files changed, 4 insertions, 2 deletions
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"
}