From 7086dfc147b2ea069cd6952437bb07a65b657730 Mon Sep 17 00:00:00 2001 From: hedy kim <47586500+waltzbucks@users.noreply.github.com> Date: Fri, 4 Oct 2024 02:16:04 +0900 Subject: [PATCH] fix(sysv script): Improvement to sysv script for the vector process start within background (#21370) * start() function update for vector daemon working on backgroud * spelling Signed-off-by: Jesse Szwedko * change log upload * spell fix out * Update changelog.d/21370-improvement-to-sysv-script.md * fix changelog fragment name Signed-off-by: Jesse Szwedko --------- Signed-off-by: Jesse Szwedko Co-authored-by: Jesse Szwedko Co-authored-by: Jesse Szwedko --- .github/actions/spelling/expect.txt | 4 ++-- changelog.d/21370-improvement-to-sysv-script.fix.md | 3 +++ distribution/init.d/vector | 3 ++- 3 files changed, 7 insertions(+), 3 deletions(-) create mode 100644 changelog.d/21370-improvement-to-sysv-script.fix.md diff --git a/.github/actions/spelling/expect.txt b/.github/actions/spelling/expect.txt index f239a69d464e9..0f5480df6332f 100644 --- a/.github/actions/spelling/expect.txt +++ b/.github/actions/spelling/expect.txt @@ -317,7 +317,6 @@ enp enumdecl enumflags envsubst -EOIG EOL'ed Err'ing errorf @@ -442,7 +441,6 @@ Godbolt gogoproto gohai goldberg -goldmark GPB gpgcheck gpgkey @@ -745,6 +743,7 @@ nodebuginfo nodistro nofield nofree +nohup nomac NONALPHANUM nonbare @@ -825,6 +824,7 @@ peekable PEMS pgmajfault pgrep +pidof PII Pitbull pkc diff --git a/changelog.d/21370-improvement-to-sysv-script.fix.md b/changelog.d/21370-improvement-to-sysv-script.fix.md new file mode 100644 index 0000000000000..012c5ae97ce6f --- /dev/null +++ b/changelog.d/21370-improvement-to-sysv-script.fix.md @@ -0,0 +1,3 @@ +The SysV init script now starts Vector in the background. + +authors: waltzbucks diff --git a/distribution/init.d/vector b/distribution/init.d/vector index 2aeb28b640822..9b820a20288bf 100644 --- a/distribution/init.d/vector +++ b/distribution/init.d/vector @@ -35,8 +35,9 @@ RETVAL=0 # Start start() { echo -n $"Starting $prog: " - daemon --pidfile=${pidfile} $vector $OPTIONS + daemon --pidfile=${pidfile} "nohup $vector /dev/null &" RETVAL=$? + [ $RETVAL = 0 ] && pidof ${prog} > ${pidfile} echo return $RETVAL }