From: "Marcin Niestrój" <m.niestroj@grinn-global.com>
To: Marek Metelski <marek.metelski@grinn-global.com>
Cc: Romain Naour <romain.naour@gmail.com>, buildroot@buildroot.org
Subject: Re: [Buildroot] [PATCH 1/1] package/gitlab-runner: fix inconsistency of systemd and sysv daemons
Date: Mon, 07 Nov 2022 17:58:37 +0100 [thread overview]
Message-ID: <878rkmsnqm.fsf@grinn-global.com> (raw)
In-Reply-To: <20221107091658.25974-1-marek.metelski@grinn-global.com>
Marek Metelski <marek.metelski@grinn-global.com> writes:
> Copy default $DEAMON_ARGS from systemd service to sysv init script.
>
> Make GITLAB_RUNNER_USER home directory the same as default
> --work-directory (-d) flag.
>
> Run sysv daemon process using root user (remove -c option)
> This is needed to correctly access config files as specified.
> System access can still be limited with gitlab-runner `--user` flag.
>
> Use same $DAEMON_ARGS variable name so it can be overwritten in
> /etc/default/gitlab-runner environment file in both cases.
>
> Signed-off-by: Marek Metelski <marek.metelski@grinn-global.com>
Reviewed-by: Marcin Niestroj <m.niestroj@grinn-global.com>
> ---
> package/gitlab-runner/S95gitlab-runner | 6 +++---
> package/gitlab-runner/gitlab-runner.mk | 3 +--
> 2 files changed, 4 insertions(+), 5 deletions(-)
>
> diff --git a/package/gitlab-runner/S95gitlab-runner b/package/gitlab-runner/S95gitlab-runner
> index 2a50e7151a..739adf1783 100644
> --- a/package/gitlab-runner/S95gitlab-runner
> +++ b/package/gitlab-runner/S95gitlab-runner
> @@ -3,7 +3,7 @@
> DAEMON="gitlab-runner"
> PIDFILE="/var/run/$DAEMON.pid"
>
> -GITLAB_RUNNER_ARGS="run"
> +DAEMON_ARGS="run --syslog --user gitlab-runner -d /var/lib/gitlab-runner -c /etc/gitlab-runner/config.toml"
>
> # shellcheck source=/dev/null
> [ -r "/etc/default/$DAEMON" ] && . "/etc/default/$DAEMON"
> @@ -11,8 +11,8 @@ GITLAB_RUNNER_ARGS="run"
> start() {
> printf 'Starting %s: ' "$DAEMON"
> # shellcheck disable=SC2086 # we need the word splitting
> - start-stop-daemon -S -q -m -b -p "$PIDFILE" -c "$DAEMON:$DAEMON" -x "/usr/bin/$DAEMON" \
> - -- $GITLAB_RUNNER_ARGS
> + start-stop-daemon -S -q -m -b -p "$PIDFILE" -x "/usr/bin/$DAEMON" \
> + -- $DAEMON_ARGS
> status=$?
> if [ "$status" -eq 0 ]; then
> echo "OK"
> diff --git a/package/gitlab-runner/gitlab-runner.mk b/package/gitlab-runner/gitlab-runner.mk
> index fde776e631..9542275135 100644
> --- a/package/gitlab-runner/gitlab-runner.mk
> +++ b/package/gitlab-runner/gitlab-runner.mk
> @@ -12,9 +12,8 @@ GITLAB_RUNNER_LICENSE_FILES = LICENSE
> GITLAB_RUNNER_LDFLAGS = \
> -X gitlab.com/gitlab-org/gitlab-runner/common.VERSION=$(GITLAB_RUNNER_VERSION)
>
> -# Don't run gitlab runner as root.
> define GITLAB_RUNNER_USERS
> - gitlab-runner -1 gitlab-runner -1 * /var/run/dbus /bin/false - Gitlab Runner
> + gitlab-runner -1 gitlab-runner -1 * /var/lib/gitlab-runner /bin/false - Gitlab Runner
> endef
>
> define GITLAB_RUNNER_INSTALL_INIT_SYSV
--
Marcin Niestrój
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot
next prev parent reply other threads:[~2022-11-07 17:01 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-07 9:16 [Buildroot] [PATCH 1/1] package/gitlab-runner: fix inconsistency of systemd and sysv daemons Marek Metelski
2022-11-07 16:58 ` Marcin Niestrój [this message]
2022-11-22 21:50 ` Thomas Petazzoni via buildroot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=878rkmsnqm.fsf@grinn-global.com \
--to=m.niestroj@grinn-global.com \
--cc=buildroot@buildroot.org \
--cc=marek.metelski@grinn-global.com \
--cc=romain.naour@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox