ubuntu20.04安装gitlab-jh失败,提示:Error executing action run on resource ‘execute[init q]’

日志如下:

  • execute echo ‘CS:123456:respawn:/opt/gitlab/embedded/bin/runsvdir-start’ >> /etc/inittab
    [2023-07-17T11:30:40+08:00] INFO: execute[echo ‘CS:123456:respawn:/opt/gitlab/embedded/bin/runsvdir-start’ >> /etc/inittab] sending run action to execute[init q] (immediate)
    • execute[init q] action run
      [execute] Couldn’t find an alternative telinit implementation to spawn.

      ================================================================================
      Error executing action run on resource ‘execute[init q]’

      Mixlib::ShellOut::ShellCommandFailed

      Expected process to exit with [0], but received ‘1’
      ---- Begin output of init q ----
      STDOUT:
      STDERR: Couldn’t find an alternative telinit implementation to spawn.
      ---- End output of init q ----
      Ran init q returned 1

      Resource Declaration:

      In /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/recipes/runit_sysvinit.rb

      28: execute “init q” do
      29: action :nothing
      30: end

      Compiled Resource:

      Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/package/recipes/runit_sysvinit.rb:28:in `from_file’

      execute(“init q”) do
      action [:nothing]
      default_guard_interpreter :execute
      command “init q”
      declared_type :execute
      cookbook_name “package”
      recipe_name “runit_sysvinit”
      domain nil
      user nil
      end

      System Info:

      chef_version=17.10.0
      platform=ubuntu
      platform_version=20.04
      ruby=ruby 3.0.6p216 (2023-03-30 revision 23a532679b) [x86_64-linux]
      program_name=/opt/gitlab/embedded/bin/cinc-client
      executable=/opt/gitlab/embedded/bin/cinc-client

[2023-07-17T11:30:40+08:00] INFO: Running queued delayed notifications before re-raising exception
[2023-07-17T11:30:40+08:00] INFO: templatesymlink[Create a gitlab.yml and create a symlink to Rails root] sending run action to execute[clear the gitlab-rails cache] (delayed)
Recipe: gitlab::gitlab-rails

  • execute[clear the gitlab-rails cache] action run[2023-07-17T11:30:40+08:00] INFO: /opt/gitlab/init/redis status does not exist.
    (skipped due to not_if)

Running handlers:
[2023-07-17T11:30:40+08:00] ERROR: Running exception handlers
There was an error running gitlab-ctl reconfigure:

execute[init q] (package::runit_sysvinit line 28) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘1’
---- Begin output of init q ----
STDOUT:
STDERR: Couldn’t find an alternative telinit implementation to spawn.
---- End output of init q ----
Ran init q returned 1

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn’t opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following Reset a user's password | GitLab.

Running handlers complete
[2023-07-17T11:30:40+08:00] ERROR: Exception handlers complete
Infra Phase failed. 112 resources updated in 10 seconds

Notes:
Default admin account has been configured with following details:
Username: root
Password: You didn’t opt-in to print initial root password to STDOUT.
Password stored to /etc/gitlab/initial_root_password. This file will be cleaned up in first reconfigure run after 24 hours.

NOTE: Because these credentials might be present in your log files in plain text, it is highly recommended to reset the password following Reset a user's password | GitLab.

[2023-07-17T11:30:40+08:00] FATAL: Stacktrace dumped to /opt/gitlab/embedded/cookbooks/cache/cinc-stacktrace.out
[2023-07-17T11:30:40+08:00] FATAL: ---------------------------------------------------------------------------------------
[2023-07-17T11:30:40+08:00] FATAL: PLEASE PROVIDE THE CONTENTS OF THE stacktrace.out FILE (above) IF YOU FILE A BUG REPORT
[2023-07-17T11:30:40+08:00] FATAL: ---------------------------------------------------------------------------------------
[2023-07-17T11:30:40+08:00] FATAL: Mixlib::ShellOut::ShellCommandFailed: execute[init q] (package::runit_sysvinit line 28) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘1’
---- Begin output of init q ----
STDOUT:
STDERR: Couldn’t find an alternative telinit implementation to spawn.
---- End output of init q ----
Ran init q returned 1
dpkg: error processing package gitlab-jh (–configure):
installed gitlab-jh package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
gitlab-jh
E: Sub-process /usr/bin/dpkg returned an error code (1)

之前选用wsl安装gitlab,环境上面可能有问题,所以出现如上错误;后面使用vmware虚拟机,再安装gitlab就正常了