From patchwork Thu Apr 7 23:19:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Benjamin Marzinski X-Patchwork-Id: 8777971 X-Patchwork-Delegate: christophe.varoqui@free.fr Return-Path: X-Original-To: patchwork-dm-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 880429F39A for ; Thu, 7 Apr 2016 23:23:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id AD356201ED for ; Thu, 7 Apr 2016 23:23:29 +0000 (UTC) Received: from mx4-phx2.redhat.com (mx4-phx2.redhat.com [209.132.183.25]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 22E5420212 for ; Thu, 7 Apr 2016 23:23:28 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by mx4-phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u37NKtnI009326; Thu, 7 Apr 2016 19:20:55 -0400 Received: from int-mx13.intmail.prod.int.phx2.redhat.com (int-mx13.intmail.prod.int.phx2.redhat.com [10.5.11.26]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id u37NKFN8027850 for ; Thu, 7 Apr 2016 19:20:15 -0400 Received: from redhat.com (octiron.msp.redhat.com [10.15.80.209]) by int-mx13.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id u37NKDPL006807; Thu, 7 Apr 2016 19:20:13 -0400 Received: by redhat.com (sSMTP sendmail emulation); Thu, 07 Apr 2016 18:20:13 -0500 From: "Benjamin Marzinski" To: device-mapper development Date: Thu, 7 Apr 2016 18:19:55 -0500 Message-Id: <1460071212-21018-2-git-send-email-bmarzins@redhat.com> In-Reply-To: <1460071212-21018-1-git-send-email-bmarzins@redhat.com> References: <1460071212-21018-1-git-send-email-bmarzins@redhat.com> X-Scanned-By: MIMEDefang 2.68 on 10.5.11.26 X-loop: dm-devel@redhat.com Cc: Christophe Varoqui Subject: [dm-devel] [PATCH v2 01/18] multipathd: use /run instead of /var/run X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP /var/run is now usually a symlink to /run. If /var is on a separate filesytem, when multipathd starts up, it might end up writing to /var/run before the /var filesytem is mounted and thus not have its pidfile accessible at /var/run afterwards. On most distrubutions /run is now a tmpfs and should always be available before multipathd is started, so multipath should just write there directly, instead of through the symlink. If /var/run is not a symlink, continue using it. Signed-off-by: Benjamin Marzinski --- Makefile.inc | 10 +++++++++- libmultipath/defaults.h | 2 +- multipathd/multipathd.init.suse | 2 +- 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/Makefile.inc b/Makefile.inc index c3ed73f..357dd33 100644 --- a/Makefile.inc +++ b/Makefile.inc @@ -21,6 +21,14 @@ ifndef LIB endif endif +ifndef RUN + ifeq ($(shell test -L /var/run -o ! -d /var/run && echo 1),1) + RUN=run + else + RUN=var/run + endif +endif + ifndef SYSTEMD ifeq ($(shell systemctl --version > /dev/null 2>&1 && echo 1), 1) SYSTEMD = $(shell systemctl --version 2> /dev/null | sed -n 's/systemd \([0-9]*\)/\1/p') @@ -54,7 +62,7 @@ ifndef RPM_OPT_FLAGS endif OPTFLAGS = $(RPM_OPT_FLAGS) -Wunused -Wstrict-prototypes -CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" +CFLAGS = $(OPTFLAGS) -fPIC -DLIB_STRING=\"${LIB}\" -DRUN_DIR=\"${RUN}\" SHARED_FLAGS = -shared %.o: %.c diff --git a/libmultipath/defaults.h b/libmultipath/defaults.h index 8902f40..cf1d5be 100644 --- a/libmultipath/defaults.h +++ b/libmultipath/defaults.h @@ -26,7 +26,7 @@ #define MAX_CHECKINT(a) (a << 2) #define MAX_DEV_LOSS_TMO 0x7FFFFFFF -#define DEFAULT_PIDFILE "/var/run/multipathd.pid" +#define DEFAULT_PIDFILE "/" RUN_DIR "/multipathd.pid" #define DEFAULT_SOCKET "/org/kernel/linux/storage/multipathd" #define DEFAULT_CONFIGFILE "/etc/multipath.conf" #define DEFAULT_BINDINGS_FILE "/etc/multipath/bindings" diff --git a/multipathd/multipathd.init.suse b/multipathd/multipathd.init.suse index d1319b1..ed699fa 100644 --- a/multipathd/multipathd.init.suse +++ b/multipathd/multipathd.init.suse @@ -17,7 +17,7 @@ PATH=/bin:/usr/bin:/sbin:/usr/sbin DAEMON=/sbin/multipathd -PIDFILE=/var/run/multipathd.pid +PIDFILE=/run/multipathd.pid MPATH_INIT_TIMEOUT=10 ARGS=""