All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [git commit] package/sysrepo: fix SysV init script
@ 2020-05-31  8:27 Yann E. MORIN
  2020-06-02  6:23 ` Peter Korsgaard
  0 siblings, 1 reply; 2+ messages in thread
From: Yann E. MORIN @ 2020-05-31  8:27 UTC (permalink / raw)
  To: buildroot

commit: https://git.buildroot.net/buildroot/commit/?id=1a14a838eaa88ae683bf8c0cb0ae6cc7e1d10d49
branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

The current script (S51sysrepo-plugind) is not able to stop the daemon.

Possible options to fix the problem:

A) By adding the "-m -p $PIDFILE" option to start the pid file will be
   created but it will not contain the correct PID used by the daemon.
   This is obviously because the daemon forks.
B) By not starting the daemon in background (sysrepo-plugind -d) and
   let do it by start-stop-daemon with "-b" option. But then the log
   messages of the daemon will not longer ends in the syslog but to stderr.
C) Start the daemon without a pidfile and stop the daemon with the
   "-x" option.

The only valid option is C to fix that.

Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
[yann.morin.1998 at free.fr: introduce EXECUTABLE]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
---
 package/sysrepo/S51sysrepo-plugind | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/sysrepo/S51sysrepo-plugind b/package/sysrepo/S51sysrepo-plugind
index 74b68396bf..60ea3ba7a9 100644
--- a/package/sysrepo/S51sysrepo-plugind
+++ b/package/sysrepo/S51sysrepo-plugind
@@ -1,7 +1,7 @@
 #!/bin/sh
 
 DAEMON="sysrepo-plugind"
-PIDFILE="/var/run/$DAEMON.pid"
+EXECUTABLE="/usr/bin/$DAEMON"
 
 SYSREPO_PLUGIND_ARGS=""
 
@@ -10,7 +10,7 @@ SYSREPO_PLUGIND_ARGS=""
 
 start() {
 	printf 'Starting %s: ' "$DAEMON"
-	start-stop-daemon -S -q -x "/usr/bin/$DAEMON" \
+	start-stop-daemon -S -q -x "$EXECUTABLE" \
 		-- $SYSREPO_PLUGIND_ARGS
 	status=$?
 	if [ "$status" -eq 0 ]; then
@@ -23,7 +23,7 @@ start() {
 
 stop() {
 	printf 'Stopping %s: ' "$DAEMON"
-	start-stop-daemon -K -q -p $PIDFILE
+	start-stop-daemon -K -q -x "$EXECUTABLE"
 	status=$?
 	if [ "$status" -eq 0 ]; then
 		echo "OK"

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [Buildroot] [git commit] package/sysrepo: fix SysV init script
  2020-05-31  8:27 [Buildroot] [git commit] package/sysrepo: fix SysV init script Yann E. MORIN
@ 2020-06-02  6:23 ` Peter Korsgaard
  0 siblings, 0 replies; 2+ messages in thread
From: Peter Korsgaard @ 2020-06-02  6:23 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > commit: https://git.buildroot.net/buildroot/commit/?id=1a14a838eaa88ae683bf8c0cb0ae6cc7e1d10d49
 > branch: https://git.buildroot.net/buildroot/commit/?id=refs/heads/master

 > The current script (S51sysrepo-plugind) is not able to stop the daemon.

 > Possible options to fix the problem:

 > A) By adding the "-m -p $PIDFILE" option to start the pid file will be
 >    created but it will not contain the correct PID used by the daemon.
 >    This is obviously because the daemon forks.
 > B) By not starting the daemon in background (sysrepo-plugind -d) and
 >    let do it by start-stop-daemon with "-b" option. But then the log
 >    messages of the daemon will not longer ends in the syslog but to stderr.
 > C) Start the daemon without a pidfile and stop the daemon with the
 >    "-x" option.

 > The only valid option is C to fix that.

 > Signed-off-by: Heiko Thiery <heiko.thiery@gmail.com>
 > [yann.morin.1998 at free.fr: introduce EXECUTABLE]
 > Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>

Committed to 2020.02.x, thanks.

-- 
Bye, Peter Korsgaard

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-06-02  6:23 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-31  8:27 [Buildroot] [git commit] package/sysrepo: fix SysV init script Yann E. MORIN
2020-06-02  6:23 ` Peter Korsgaard

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.