Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Debian daemon not works #1671

Closed
m1roff opened this issue Sep 21, 2015 · 32 comments
Closed

Debian daemon not works #1671

m1roff opened this issue Sep 21, 2015 · 32 comments
Labels
📦 deployment Related to deployments status: needs feedback Tell me more about it
Milestone

Comments

@m1roff
Copy link

m1roff commented Sep 21, 2015

Istalled under user git to directory /home/git/gogs

If run
./gogs/gogs web --config ./gogs/custom/conf/app.ini
all works

2015/09/21 20:01:18 [T] Custom path: /home/git/gogs
2015/09/21 20:01:18 [T] Log path: /home/git/gogs/log
2015/09/21 20:01:18 [I] GitMelarn 0.6.9.0903 Beta
2015/09/21 20:01:18 [I] Log Mode: File(Info)
2015/09/21 20:01:18 [I] Redis Supported
2015/09/21 20:01:18 [I] Memcache Supported
2015/09/21 20:01:18 [I] Cache Service Enabled
2015/09/21 20:01:18 [I] Session Service Enabled
2015/09/21 20:01:18 [I] Mail Service Enabled
2015/09/21 20:01:19 [I] SQLite3 Supported
2015/09/21 20:01:19 [I] Run Mode: Production
2015/09/21 20:01:19 [T] Doing: CheckRepoStats
2015/09/21 20:01:19 [I] Listen: http://0.0.0.0:3000

than a file from scripts/init/debian/gogs were copied to /etc/init.d/gogs and all works with adding it to system done.
when
$ sudo service gogs start
server gogs not work (it gives '502 Bad Gateway')

and if

$ sudo service gogs status
● gogs.service - LSB: A self-hosted Git service written in Go.
   Loaded: loaded (/etc/init.d/gogs)
   Active: active (exited) since Пн 2015-09-21 19:49:03 MSK; 14min ago

and nothing here

ps ax | grep gogs
 1028 pts/0    S+     0:00 grep gogs

and here
sudo netstat -tulpn

and more

$ sudo service gogs stop
$ sudo service gogs status
● gogs.service - LSB: A self-hosted Git service written in Go.
   Loaded: loaded (/etc/init.d/gogs)
   Active: inactive (dead) since Пн 2015-09-21 20:05:11 MSK; 1s ago
  Process: 984 ExecStop=/etc/init.d/gogs stop (code=exited, status=0/SUCCESS)

сен 21 20:05:11 mgit gogs[984]: Stopping Go Git Service: gogs.

What im doing wron?

@oxyno-zeta
Copy link

I don't for your version. But I see that the init script has been changed between 0.6.1 and 0.6.13. I do the update from one to the other and I keep the old script. No problem for me. Maybe try with the old one.

Update : The one that works for me is with the commit number : 98c719c
And I confirm that there is something wrong with the new script

@JokerQyou
Copy link

I've seen this today.

If I run sudo service gogs start, and gogs will not start, the init script left the /var/run/gogs.pid file there, but there is no gogs process, and sudo service gogs status will tell you that too.
But if I run /etc/init.d/gogs start, gogs will run, and sudo service gogs status gives the status too.

I think there's something wrong with the startup procedure.

@JokerQyou
Copy link

@unknwon
Copy link
Member

unknwon commented Sep 25, 2015

Thanks your feedback!

But you have to dump the log info here so we can help you...

@unknwon unknwon added 📦 deployment Related to deployments status: needs feedback Tell me more about it labels Sep 25, 2015
@JokerQyou
Copy link

Right now I'm using the init script just before 98c719c and it's working fine. I'll try the latest script and see what's in the log once I get back home.

@m1roff
Copy link
Author

m1roff commented Sep 25, 2015

I tried to watch log, there is empty

@unknwon
Copy link
Member

unknwon commented Sep 25, 2015

@Mirkhamidov I've met someone has similar issue before, so if there is no log for daemon(whatever service tool you use), it does not start Gogs anyway.

The final solution to him is switch to supervisor and works very well.

@unknwon unknwon added this to the 0.7.5 milestone Sep 25, 2015
@m1roff
Copy link
Author

m1roff commented Sep 25, 2015

Can you explain how?

@m1roff
Copy link
Author

m1roff commented Sep 25, 2015

tnx, I will try

@unknwon
Copy link
Member

unknwon commented Sep 25, 2015

😉

@m1roff
Copy link
Author

m1roff commented Sep 28, 2015

@JokerQyou it helped!)))

but, now, if I restart server I got in /home/git/gogs/log/gogs.log:

2015/09/28 11:44:00 [I] Log Mode: File(Info)
2015/09/28 11:44:00 [I] Redis Supported
2015/09/28 11:44:00 [I] Memcache Supported
2015/09/28 11:44:00 [I] Cache Service Enabled
2015/09/28 11:44:00 [I] Session Service Enabled
2015/09/28 11:44:00 [I] Mail Service Enabled
2015/09/28 11:44:00 [...s/routers/install.go:65 GlobalInit()] [E] Fail to initialize ORM engine: migrate: sync: pq: система баз данных запускается

but if I did

sudo service gogs restart

it starts properly

2015/09/28 11:45:31 [I] Log Mode: File(Info)
2015/09/28 11:45:31 [I] Redis Supported
2015/09/28 11:45:31 [I] Memcache Supported
2015/09/28 11:45:31 [I] Cache Service Enabled
2015/09/28 11:45:31 [I] Session Service Enabled
2015/09/28 11:45:31 [I] Mail Service Enabled
2015/09/28 11:45:32 [I] SQLite3 Supported
2015/09/28 11:45:32 [I] Run Mode: Production
2015/09/28 11:45:32 [I] Listen: http://0.0.0.0:3000

im using postgresql, why it wrote SQLite3 Supported?((

@tboerger
Copy link
Contributor

im using postgresql, why it wrote SQLite3 Supported?((

This just shows that gogs is compiled with SQLite3 support, nothing else.

@JokerQyou
Copy link

I suppose it's just because SQLite is supported, it did not say 'SQLite enabled' or 'SQLite in use'.
Which script are you using? The old version in this repo or the one of syncthing?

I think it might be because by the time Gogs starts, your Postgres daemon has not yet finished starting.

@m1roff
Copy link
Author

m1roff commented Sep 28, 2015

@tboerger, @JokerQyou I see

@JokerQyou this one 98c719c

But what should I do, to work it properly?

@JokerQyou
Copy link

I know very little about shell script, so sorry I cannot say. I've not tested server reboot yet.

@unknwon
Copy link
Member

unknwon commented Sep 28, 2015

@Mirkhamidov I think you should just Google the posgresql error and I can't help because the error message is not in English 😭

@JokerQyou
Copy link

The meaaage simply indicates the database server has started

On Mon, Sep 28, 2015, 19:18 无闻 notifications@github.com wrote:

@Mirkhamidov https://github.com/mirkhamidov I think you should just
Google the posgresql error and I can't help because the error message is
not in English [image: 😭]


Reply to this email directly or view it on GitHub
#1671 (comment).

@unknwon
Copy link
Member

unknwon commented Sep 28, 2015

@JokerQyou Hmm... if just a info message, when pg returns as error?

@JokerQyou
Copy link

This is the result of Google translate.
image

If it was 'database system not launched', it would make sense.

@m1roff
Copy link
Author

m1roff commented Sep 28, 2015

gogs need to start after pg started

@unknwon
Copy link
Member

unknwon commented Sep 28, 2015

@Mirkhamidov seems like you found solution?

@m1roff
Copy link
Author

m1roff commented Sep 28, 2015

no, just, not using gogs yet. Will wait when it will be ready.
For tests, I just restart service after booting, and all works fine.

@unknwon
Copy link
Member

unknwon commented Sep 28, 2015

gogs need to start after pg started

Then what does this comment suppose to mean... ?

@JokerQyou
Copy link

I think we know the reason why it's behaving that way -- Gogs started before Postgres server is ready, but I don't have any solution.

@unknwon
Copy link
Member

unknwon commented Sep 28, 2015

I'm not using init.d but for systemd, see https://github.com/gogits/gogs/blob/master/scripts/systemd/gogs.service#L5 . I suppose init.d has something similar...

@m1roff
Copy link
Author

m1roff commented Sep 28, 2015

ok

@manfer
Copy link
Contributor

manfer commented Sep 28, 2015

It should be easy to tell the init script that it requires postgreSQL.

Those that use PostgreSQL change line:

https://github.com/gogits/gogs/blob/master/scripts/init/debian/gogs#L4

to:

# Required-Start:    $syslog $network postgresql

This will ensure that gogs runs after postgreSQL daemon has started. You need to enable the postgresql script to run on start too if it hasn't been already done.

sudo chkconfig postgresql on

@seeseekey
Copy link

After use the current init file (not the file in the release) (4a05c4a#diff-2010a922586cdf277b495c360c8a66a3) it works.

@unknwon unknwon modified the milestones: 0.7.0, 0.7.5 Oct 16, 2015
@unknwon
Copy link
Member

unknwon commented Oct 16, 2015

@seeseekey thanks your confirmation!

@MarcosBL
Copy link

This change fixed the issue for me as well

4a05c4a#diff-2010a922586cdf277b495c360c8a66a3

@unknwon
Copy link
Member

unknwon commented Oct 24, 2015

Close for now but open for continuing discussion.

@unknwon unknwon closed this as completed Oct 24, 2015
@unknwon unknwon modified the milestones: 0.7.0, 0.8.0 Oct 24, 2015
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 14, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
📦 deployment Related to deployments status: needs feedback Tell me more about it
Projects
None yet
Development

No branches or pull requests

8 participants