소스 검색

package/sysrepo: fix SysV init script

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@free.fr: introduce EXECUTABLE]
Signed-off-by: Yann E. MORIN <yann.morin.1998@free.fr>
(cherry picked from commit 1a14a838eaa88ae683bf8c0cb0ae6cc7e1d10d49)
Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
Heiko Thiery 5 년 전
부모
커밋
1f0116e448
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      package/sysrepo/S51sysrepo-plugind

+ 3 - 3
package/sysrepo/S51sysrepo-plugind

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