From 041efca59326baf7c2ec08dd505e06ae86dd6954 Mon Sep 17 00:00:00 2001 From: Lance Albertson Date: Wed, 25 Jul 2012 16:21:21 -0700 Subject: [PATCH] Check if process is already running and skip if so Gentoo uses a modified version of start-stop-daemon which returns an error if it sees another process running with the same name. This happens during cluster initialization since ganeti-noded gets fired off first. --- daemons/daemon-util.in | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/daemons/daemon-util.in b/daemons/daemon-util.in index 00fe1b6..8e4ce97 100644 --- a/daemons/daemon-util.in +++ b/daemons/daemon-util.in @@ -172,11 +172,13 @@ start() { @PKGLIBDIR@/ensure-dirs - start-stop-daemon --start --quiet \ - --pidfile $(_daemon_pidfile $name) \ - --exec $(_daemon_executable $name) \ - --user $(_daemon_usergroup $plain_name) \ - -- $args "$@" + if ! ret=$(/usr/bin/pgrep $name) ; then + start-stop-daemon --start --quiet \ + --pidfile $(_daemon_pidfile $name) \ + --exec $(_daemon_executable $name) \ + --user $(_daemon_usergroup $plain_name) \ + -- $args "$@" + fi } # Stops a daemon -- 1.7.9.5