All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v2 1/1] package/syrepo: fix SysV init script
@ 2020-05-27  7:11 Heiko Thiery
  2020-05-31  8:29 ` Yann E. MORIN
  0 siblings, 1 reply; 2+ messages in thread
From: Heiko Thiery @ 2020-05-27  7:11 UTC (permalink / raw)
  To: buildroot

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>
---
changes v1 -> v2:
	Add a proper commit message.

---
 package/sysrepo/S51sysrepo-plugind | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

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

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

* [Buildroot] [PATCH v2 1/1] package/syrepo: fix SysV init script
  2020-05-27  7:11 [Buildroot] [PATCH v2 1/1] package/syrepo: fix SysV init script Heiko Thiery
@ 2020-05-31  8:29 ` Yann E. MORIN
  0 siblings, 0 replies; 2+ messages in thread
From: Yann E. MORIN @ 2020-05-31  8:29 UTC (permalink / raw)
  To: buildroot

Heiko, All,

On 2020-05-27 09:11 +0200, Heiko Thiery spake thusly:
> 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>

Applied to master, after fixing the typo in the title, and see below...

> ---
> changes v1 -> v2:
> 	Add a proper commit message.
> 
> ---
>  package/sysrepo/S51sysrepo-plugind | 3 +--
>  1 file changed, 1 insertion(+), 2 deletions(-)
> 
> diff --git a/package/sysrepo/S51sysrepo-plugind b/package/sysrepo/S51sysrepo-plugind
> index 74b68396bf..9e15da59f9 100644
> --- a/package/sysrepo/S51sysrepo-plugind
> +++ b/package/sysrepo/S51sysrepo-plugind
> @@ -1,7 +1,6 @@
>  #!/bin/sh
>  
>  DAEMON="sysrepo-plugind"
> -PIDFILE="/var/run/$DAEMON.pid"
>  
>  SYSREPO_PLUGIND_ARGS=""
>  
> @@ -23,7 +22,7 @@ start() {
>  
>  stop() {
>  	printf 'Stopping %s: ' "$DAEMON"
> -	start-stop-daemon -K -q -p $PIDFILE
> +	start-stop-daemon -K -q -x "/usr/bin/$DAEMON"

I've introduced EXECUTABLE to hold that path, and used it consistently
in the start() and stop().

Applied to master, thanks.

Regards,
Yann E. MORIN.

>  	status=$?
>  	if [ "$status" -eq 0 ]; then
>  		echo "OK"
> -- 
> 2.20.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot at busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'

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

end of thread, other threads:[~2020-05-31  8:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-27  7:11 [Buildroot] [PATCH v2 1/1] package/syrepo: fix SysV init script Heiko Thiery
2020-05-31  8:29 ` Yann E. MORIN

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.