Gitlab runner status show "the service is not installed" but it was installed and run successfully
Asked Answered
C

2

7

I installed Gitlab-runner in WSL Ubuntu 20. Firstly, I have registered runner and ran successfully. But when I check the status of Gitlab-runner it show:

namlb@Admin:/etc/init.d$ sudo gitlab-runner status
Runtime platform                                    arch=amd64 os=linux pid=2170 revision=e0218c92
version=14.3.2
gitlab-runner: the service is not installed

And another thing that confused me is that my runner just execute job when I already run gitlab-runner run command, whilst in some guides they just need run gitlab-runner start and job will be execute when triggered.

Here is some info about my gitlab-runner:

namlb@Admin:~$ sudo gitlab-runner start
[sudo] password for namlb:
Runtime platform                                    arch=amd64 os=linux pid=2563 revision=e0218c92 version=14.3.2
namlb@Admin:~$ gitlab-runner status
Runtime platform                                    arch=amd64 os=linux pid=2609 revision=e0218c92 version=14.3.2
FATAL: The --user is not supported for non-root users
namlb@Admin:~$ sudo gitlab-runner status
Runtime platform                                    arch=amd64 os=linux pid=2635 revision=e0218c92 version=14.3.2
gitlab-runner: the service is not installed
namlb@Admin:~$ gitlab-runner verify
Runtime platform                                    arch=amd64 os=linux pid=2686 revision=e0218c92 version=14.3.2
WARNING: Running in user-mode.
WARNING: The user-mode requires you to manually start builds processing:
WARNING: $ gitlab-runner run
WARNING: Use sudo for system-mode:
WARNING: $ sudo gitlab-runner...

Verifying runner... is alive                        runner=22WNSZ6v
Commix answered 23/10, 2021 at 3:32 Comment(0)
P
2

Run "service gitlab-runner status" for more information.

When I got the message "gitlab-runner: the service is not installed" I realized that the file /usr/lib/gitlab-runner/gitlab-runner had incorrect permissions.

Philipps answered 4/8, 2022 at 18:53 Comment(1)
Your answer could be improved with additional supporting information. Please edit to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers in the help center.Fustic
D
2

for Ubuntu

Change your /etc/init.d/gitlab-runner

...
DAEMON="/usr/bin/gitlab-runner"
DESC="GitLab Runner"
USER="gitlab-runner"
...
--exec "$DAEMON" --  "run" "--working-directory" "/var/lib/gitlab-runner" "--config" "/etc/gitlab-runner/config.toml" "--service" "gitlab-runner" "--syslog" "--user" "$USER"
...

Variable $DAEMON not defined and is used

  status)
    status_of_proc -p "$PIDFILE" "$DAEMON" "$DESC"
    ;;
  *)
Discontinuance answered 28/12, 2022 at 11:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.