gogits/gogs — pull request #511 by silverkorn (2014-09-28 22:32:14+00:00)
Title: Added "init.d" service script for Debian-based Linux.

Compatible with "/etc/default/gogs" configuration file for adding or overwriting values.
Based on "/etc/init.d/skeleton" and tested on Raspbian 2014-06-20 (Debian 7.5 [Wheezy] ARM)

*** For some reason, it's necessary to remove the value of __RUN_USER__ from the __app.ini__ configuration file because the following error occurs:
`2014/09/28 18:12:53 [setting.go:182 NewConfigContext()] [E] Expect user(git) but current user is: `

I've tested to print a "whoami" and "id" but everything is printing the current user properly and calling directly to "start-stop-daemon" instead of spawning a children with "sh -c" still prints this error.

If you wish to debug it, remove the "--background" parameter in the second "start-stop-daemon" call.

Wish this helps! :smile: