search

Home  >  Q&A  >  body text

CentOS gogs服务启动失败?

我安装了gogs,手动执行启动脚本是能启动的,但是做成服务就是无法启动,也不报错,不知道是什么原因,有谁知道可以去哪里查service的启动日志吗?gogs文件在/etc/rc.d/init.d/gogs下面,使用chkconfig --add gogschkconfig gogs on添加到开机启动,看/var/log/boot.log是看到有启动这个服务,但是进程中却无法看到,也不能访问,然后就尝试servcie gogs start,显示结果如下:

[root@localhost init.d]# service gogs start
Starting Gogs Go Git Service:                              [  OK  ]

虽然显示成功了,但还是无法访问,也没有进程,端口也没有监听,然后尝试使用/etc/rc.d/init.d/gogs start却是可以正常启动,并且能够访问,现在就纠结了,到底是什么原因导致service gogs start启动无效呢?

巴扎黑巴扎黑2768 days ago1514

reply all(2)I'll reply

  • 淡淡烟草味

    淡淡烟草味2017-04-26 09:02:59

    You have to put other files of gogs in the directory where it is executed, and run it with parameters

    reply
    0
  • 漂亮男人

    漂亮男人2017-04-26 09:02:59

    I also encountered this problem.
    In the official startup script, the corresponding dependent services are commented out.
    https://github.com/gogits/gogs/blob/master/scripts/systemd/gogs.service

    results in the following error:

    [...s/routers/install.go:71 GlobalInit()] [E] Fail to initialize ORM engine: migrate: sync: dial tcp 127.0.0.1:3306: getsockopt: connection refused
    

    Just remove the comment. I use mariadb and I added it.

    reply
    0
  • Cancelreply