0

I enabled gog service and got the following messages.

$ sudo systemctl enable gogs
Synchronizing state for gogs.service with sysvinit using update-rc.d...
Executing /usr/sbin/update-rc.d gogs defaults
insserv: warning: script 'K01tightvncserver' missing LSB tags and overrides
insserv: warning: script 'tightvncserver' missing LSB tags and overrides
Executing /usr/sbin/update-rc.d gogs enable
update-rc.d: error: gogs Default-Start contains no runlevels, aborting.

beside just warnings I spotted error related to gogs run levels, how do I set the runlevels for gogs service , this service is supposed to start after LAMP services are running.

the /etc/inittab file is not there, maybe raspbian handles differently then cents

I ran the below command and get the following message.

$ sudo systemctl status gogs.service
● gogs.service - Gogs (Go Git Service)
   Loaded: loaded (/etc/systemd/system/gogs.service; enabled)
   Active: failed (Result: start-limit) since Sat 2016-09-03 05:39:14 UTC; 18s ago
  Process: 1411 ExecStart=/home/git/gogs/gogs web (code=exited, status=1/FAILURE)
 Main PID: 1411 (code=exited, status=1/FAILURE)

Sep 03 05:39:14 raspberrypi systemd[1]: Unit gogs.service entered failed state.
Sep 03 05:39:14 raspberrypi systemd[1]: gogs.service holdoff time over, scheduling restart.
Sep 03 05:39:14 raspberrypi systemd[1]: Stopping Gogs (Go Git Service)...
Sep 03 05:39:14 raspberrypi systemd[1]: Starting Gogs (Go Git Service)...
Sep 03 05:39:14 raspberrypi systemd[1]: gogs.service start request repeated too quickly, refusing to start.
Sep 03 05:39:14 raspberrypi systemd[1]: Failed to start Gogs (Go Git Service).
Sep 03 05:39:14 raspberrypi systemd[1]: Unit gogs.service entered failed state.
2

The /etc/inittab file is not there because you are using a systemd operating system. You do not use /etc/inittab, as it is a thing of the past; you do not use run levels, as they are "obsolete" per the systemd doco; and you do not use van Smoorenburg rc scripts.

Ferenc Wágner thinks that you are using a "distribution-provided script". You are clearly not. Debian doesn't include gogs and the person who asked for it to be packaged in Debian later said that it was likely impossible, for starters. You are not using anything "distribution-provided".

You clearly are not even using the gogs-own van Smoorenburg rc script, either. As can be seen, that actually does contain the LSB headers that M. Wágner comments upon, and always has done.

But all of this discussion of how to fix your non-Debian non-gogs van Smoorenburg rc script is misdirected effort. You are using a systemd operating system and gogs comes with a systemd service unit. Use it!

It's gogs.service, right there in the gogs source.

It even has some service ordering relationship suggestions.

Further reading

1
  • If run levels are obsolete according to docs and I have not set it either then why enabling gogs service is expecting run levels Sep 2 '16 at 5:46
0

At the start of /etc/init.d/gogs there should be a comment block like

### BEGIN INIT INFO
# Provides:             gogs
# Required-Start:       apache mysql
# Required-Stop:        apache mysql
# Default-Start:        2 3 4 5
# Default-Stop:         
# Short-Description:    no idea what this could be
### END INIT INFO

Your error message states that Default-Start contains no runlevels. This is strange, a distro-provided init script should really have it. Try to fill it in like in the example above (totally from the top of my head).

2
  • I just checked today I do have this file /etc/init.d/gogs already, and it is set to be executable too, but still it seems to be not starting after boot up Sep 3 '16 at 5:36
  • I knew it existed, I suggested filling in its Default-Start settings. But if you've got a native systemd service file as JdeBP states, you'd better enable that instead of using a modified SysV init script through the compatibility layer of systemd. So: systemctl enable /path/to/gogs.service. Sep 3 '16 at 11:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.