From patchwork Wed Jan 1 01:22:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11314953 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id EDD90109A for ; Wed, 1 Jan 2020 01:24:09 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id CBECF20718 for ; Wed, 1 Jan 2020 01:24:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="QG8zdFVo" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727186AbgAABYJ (ORCPT ); Tue, 31 Dec 2019 20:24:09 -0500 Received: from aserp2120.oracle.com ([141.146.126.78]:59770 "EHLO aserp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbgAABYJ (ORCPT ); Tue, 31 Dec 2019 20:24:09 -0500 Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011O7hc097544; Wed, 1 Jan 2020 01:24:07 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=dVxrB9y/Bn3Vg46k86csOlgfGeUJBm9UGgtmUKemPhc=; b=QG8zdFVork9i/wB9zmPV64CwRKqKs7HxVdOZlRO9ibJ+8JtnsKQ1ojhRvEHLa/ycewIX S+XTBDPRNLBBSeNmrMa11ebtGirV7+YcaX8Llb9A5qbyssFH5OZU8fIH0KzA1QCZEFM6 bxw9unl2Nn5EjW9+HZLSd6xabYlEX1d5hW7I4tU9iQgTaFaIcx/xVEOaWsS0d0GrPsdS 5kfbx6e6fT62pnlb9/Og4a8FrNriE154AQmJffQgUr5FQHBbtlTk6yBoWy7ZGHjPIDaw +39gC+fIGK2RihpBRIJ6mKsQng/0xGFG3fxWdvTfMb1qYg0EQQfQO0DPq64k5nPS74pu NA== Received: from userp3030.oracle.com (userp3030.oracle.com [156.151.31.80]) by aserp2120.oracle.com with ESMTP id 2x5y0pjy9d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:24:07 +0000 Received: from pps.filterd (userp3030.oracle.com [127.0.0.1]) by userp3030.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011O4xg190950; Wed, 1 Jan 2020 01:24:06 GMT Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userp3030.oracle.com with ESMTP id 2x8gj91e8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:24:05 +0000 Received: from abhmp0013.oracle.com (abhmp0013.oracle.com [141.146.116.19]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0011Mo8P001677; Wed, 1 Jan 2020 01:22:50 GMT Received: from localhost (/10.159.150.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 31 Dec 2019 17:22:50 -0800 Subject: [PATCH 1/4] misc: support building flatpak images From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Tue, 31 Dec 2019 17:22:47 -0800 Message-ID: <157784176718.1372453.6932244685934321782.stgit@magnolia> In-Reply-To: <157784176039.1372453.10128269126585047352.stgit@magnolia> References: <157784176039.1372453.10128269126585047352.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010011 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Poke the system until it supports building flatpaks. Maybe. Signed-off-by: Darrick J. Wong --- bootstrap | 12 ++++++++++++ flatpak.sh | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 67 insertions(+) create mode 100755 bootstrap create mode 100755 flatpak.sh diff --git a/bootstrap b/bootstrap new file mode 100755 index 00000000..d403cf58 --- /dev/null +++ b/bootstrap @@ -0,0 +1,12 @@ +#!/bin/bash -x + +libtoolize +automake --add-missing +aclocal -I m4 +autoconf +make configure +libtoolize +automake --add-missing +aclocal -I m4 +autoconf +make configure diff --git a/flatpak.sh b/flatpak.sh new file mode 100755 index 00000000..a1ec916e --- /dev/null +++ b/flatpak.sh @@ -0,0 +1,55 @@ +#!/bin/bash -xe + +if [ "$1" = "--help" ]; then + echo "Usage: $0 [branch] [build]" + echo "Build xfsprogs flatpak from the given branch." +fi + +branch="$1" +test -z "${branch}" && branch=master +build="$2" +test -z "${build}" && build=release + +if [ "${build}" = "debug" ]; then + config_opts=', "--disable-lto"' +fi + +cat > flatpak.ini << ENDL +[Application] +name=org.xfs.progs +runtime=org.freedesktop.Platform/$(uname -m)/18.08 + +[Context] +devices=all; +ENDL + +cat > org.xfs.progs.json << ENDL +{ + "app-id": "org.xfs.progs", + "runtime": "org.freedesktop.Platform", + "runtime-version": "18.08", + "sdk": "org.freedesktop.Sdk", + "command": "/app/sbin/xfs_repair", + "metadata": "flatpak.ini", + "modules": [ + { + "name": "xfsprogs", + "buildsystem": "autotools", + "config-opts": ["--enable-shared=no" ${config_opts} ], + "sources": [ + { + "type": "git", + "path": "${PWD}/", + "branch": "${branch}" + } + ] + } + ] +} +ENDL + +flatpak-builder --repo=repo build-dir org.xfs.progs.json --force-clean +flatpak build-bundle repo xfsprogs.flatpak org.xfs.progs +echo build done, run: +echo flatpak install xfsprogs.flatpak +echo flatpak run org.xfs.progs From patchwork Wed Jan 1 01:22:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11314945 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3B028109A for ; Wed, 1 Jan 2020 01:23:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 149E020718 for ; Wed, 1 Jan 2020 01:23:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="jWF5fXWH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727175AbgAABXa (ORCPT ); Tue, 31 Dec 2019 20:23:30 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:60702 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727171AbgAABXa (ORCPT ); Tue, 31 Dec 2019 20:23:30 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011EOGD112611; Wed, 1 Jan 2020 01:23:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=dHkXvt+K40ARy4AnVJrVfPcjtMFTfCgQgydqdhZiC/I=; b=jWF5fXWHmAlPmWNlVxE5DYpQpRj3ylxT0ZqrCIFUGs1lnjD1mRV92bjOYzHQzH9vgzoN 5NxWGMWC+urybo25BFjBqhLRW6bjlNVbUtJ5QC72faeco+BeL2/piMmJLt5hx/VbcjPw 2MbWKGF5+9v+vpJ4MMAgSV1I6gZ+cedCBSBqvX/azhYCOdEUG7qNFhnYDxTB+UCDJD1/ tCieMT7Yv2aJsP/TAyAORHbduT+ZgswtGwkqWVXtORLqPdcnAIjFA5A0LZ1yF6AW/TxX ToZQWl/1kwLN19ZpDKExlS4MxZ48YY8RPpQnFvLj7Q76W1hQAhmo45+tKUYRFUKMmgWe 9Q== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2x5xftk2ts-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:23:28 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011NSol012919; Wed, 1 Jan 2020 01:23:28 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userp3020.oracle.com with ESMTP id 2x8bsrg880-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:23:27 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0011MwQV017113; Wed, 1 Jan 2020 01:22:58 GMT Received: from localhost (/10.159.150.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 31 Dec 2019 17:22:58 -0800 Subject: [PATCH 2/4] debian: turn debhelper compat level up to 11 From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Tue, 31 Dec 2019 17:22:53 -0800 Message-ID: <157784177377.1372453.1008055450028015778.stgit@magnolia> In-Reply-To: <157784176039.1372453.10128269126585047352.stgit@magnolia> References: <157784176039.1372453.10128269126585047352.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=919 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=977 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010010 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Upgrade to debhelper level 11 to take advantage of dh_installsystemd, which greatly simplifies the installation and activation of the scrub systemd services. Signed-off-by: Darrick J. Wong --- debian/compat | 2 +- debian/rules | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/debian/compat b/debian/compat index ec635144..b4de3947 100644 --- a/debian/compat +++ b/debian/compat @@ -1 +1 @@ -9 +11 diff --git a/debian/rules b/debian/rules index e8509fb3..a79db896 100755 --- a/debian/rules +++ b/debian/rules @@ -93,6 +93,7 @@ binary-arch: checkroot built dh_compress dh_fixperms dh_makeshlibs + dh_installsystemd -p xfsprogs --no-enable --no-start --no-restart-after-upgrade --no-stop-on-upgrade dh_installdeb dh_shlibdeps dh_gencontrol From patchwork Wed Jan 1 01:23:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11314951 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2EE131395 for ; Wed, 1 Jan 2020 01:23:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0DED52072A for ; Wed, 1 Jan 2020 01:23:39 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="fpOeRus5" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727168AbgAABXi (ORCPT ); Tue, 31 Dec 2019 20:23:38 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:56270 "EHLO userp2120.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727183AbgAABXi (ORCPT ); Tue, 31 Dec 2019 20:23:38 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011Naed099300; Wed, 1 Jan 2020 01:23:36 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=d6YyR+3/SyAQbnIVj5SflHJt9L+mbL1eEhcpgPYOIr8=; b=fpOeRus5WejAsCxnKJo1YLdy/+TWcjG3Xqontm8rdnHqztxQbyEun9N4Iak3ZDyoMYCf QwNzB2fk01D0Nz1OhwIBPQIfLXt0XLXXnMmaCqL6StjeKcOdmmInawIJZF7dHU3oNGKe NaOKiBfnPJuavpIhnvYo7jpndR5Q4tojOQky1GKGLNQmlLOv775BaTytGardaqtVrZ66 LDtX666d/g24W5jOmp59WKaTlwwfwjnTHq73hNu04v8z2U7HRlWev8HbmpM+lxqnc9EQ pq2gBCHAjyT56x2zTk8k45GYkXtMvyxgRWKmKKK3/q3zGgevw4NJRsXK+/dNAMwEMGAN RQ== Received: from aserp3020.oracle.com (aserp3020.oracle.com [141.146.126.70]) by userp2120.oracle.com with ESMTP id 2x5ypqjwt4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:23:35 +0000 Received: from pps.filterd (aserp3020.oracle.com [127.0.0.1]) by aserp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011NYQk030298; Wed, 1 Jan 2020 01:23:35 GMT Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by aserp3020.oracle.com with ESMTP id 2x8gueg9n4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:23:34 +0000 Received: from abhmp0018.oracle.com (abhmp0018.oracle.com [141.146.116.24]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id 0011N45u017118; Wed, 1 Jan 2020 01:23:04 GMT Received: from localhost (/10.159.150.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 31 Dec 2019 17:23:04 -0800 Subject: [PATCH 3/4] debian: permit compat level 9 dh builds From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Tue, 31 Dec 2019 17:23:01 -0800 Message-ID: <157784178177.1372453.9672761082907118417.stgit@magnolia> In-Reply-To: <157784176039.1372453.10128269126585047352.stgit@magnolia> References: <157784176039.1372453.10128269126585047352.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010010 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Retain compatibility with existing dh level 9 build systems. Signed-off-by: Darrick J. Wong --- debian/rules | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/debian/rules b/debian/rules index a79db896..1dd1f524 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,7 @@ #!/usr/bin/make -f +.PHONY: dpkg_config + export DH_VERBOSE=1 ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) @@ -7,6 +9,9 @@ ifneq (,$(filter parallel=%,$(DEB_BUILD_OPTIONS))) PMAKEFLAGS += -j$(NUMJOBS) endif +DH_VERSION := $(shell dpkg-query -W -f '$${Version}' debhelper) +USE_DH9 ?= $(shell if dpkg --compare-versions $(DH_VERSION) lt 11 ; then echo yes ; fi) + package = xfsprogs develop = xfslibs-dev bootpkg = xfsprogs-udeb @@ -33,11 +38,18 @@ checkdir = test -f debian/rules build: build-arch build-indep build-arch: built build-indep: built -built: dibuild config +built: dpkg_config dibuild config @echo "== dpkg-buildpackage: build" 1>&2 $(MAKE) $(PMAKEFLAGS) default touch built +dpkg_config: +ifeq ($(USE_DH9),yes) + mv debian/compat debian/compat.save + echo 9 > debian/compat +endif + @true + config: .census .census: @echo "== dpkg-buildpackage: configure" 1>&2 @@ -93,7 +105,9 @@ binary-arch: checkroot built dh_compress dh_fixperms dh_makeshlibs +ifneq ($(USE_DH9),yes) dh_installsystemd -p xfsprogs --no-enable --no-start --no-restart-after-upgrade --no-stop-on-upgrade +endif dh_installdeb dh_shlibdeps dh_gencontrol From patchwork Wed Jan 1 01:23:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Darrick J. Wong" X-Patchwork-Id: 11314947 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 38D6C109A for ; Wed, 1 Jan 2020 01:23:32 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 196422072A for ; Wed, 1 Jan 2020 01:23:32 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=oracle.com header.i=@oracle.com header.b="NhAOPSln" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727171AbgAABXb (ORCPT ); Tue, 31 Dec 2019 20:23:31 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:60708 "EHLO userp2130.oracle.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727168AbgAABXb (ORCPT ); Tue, 31 Dec 2019 20:23:31 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011FsnS113342; Wed, 1 Jan 2020 01:23:28 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=subject : from : to : cc : date : message-id : in-reply-to : references : mime-version : content-type : content-transfer-encoding; s=corp-2019-08-05; bh=Go8/TBV2ER2b0ITDFnR9fE7TWZNyr3kqwZAIema6ORg=; b=NhAOPSlnNYw/vBRUJCkX7AsGtW/XCipMd3L/Hvo64PFamIi6UzcgLBIC1R7Q4OGqK/Vw djUZL87NeWnrMQ/ylTSPzRQYvPgYbXD0P2CvjuQIux1k4rIGFcKYHz1LP20UkmueGGdS +IA0Tx70HsmUD/Xb+kCJLuWkycN/fh5URMi8wY5iJMyHbDH0DSn71kJUDyZ3LZh4jkyj 5YkOGU5N+5kKaCuhvY1tGnjF+ByX1CEOhzCCoZqqK1hcNmfv1MC849JG/S1lGDqlBhvh LFARPhnT++clCFhXcM/Yohsn+wEOYoJepAOwkIIAirZD48iG27+B3mIZ1qeCMp8Vd7EH KQ== Received: from userp3020.oracle.com (userp3020.oracle.com [156.151.31.79]) by userp2130.oracle.com with ESMTP id 2x5xftk2tw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:23:28 +0000 Received: from pps.filterd (userp3020.oracle.com [127.0.0.1]) by userp3020.oracle.com (8.16.0.27/8.16.0.27) with SMTP id 0011NSai012926; Wed, 1 Jan 2020 01:23:28 GMT Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userp3020.oracle.com with ESMTP id 2x8bsrg89t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 01 Jan 2020 01:23:27 +0000 Received: from abhmp0008.oracle.com (abhmp0008.oracle.com [141.146.116.14]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id 0011NAIW004246; Wed, 1 Jan 2020 01:23:10 GMT Received: from localhost (/10.159.150.156) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Tue, 31 Dec 2019 17:23:10 -0800 Subject: [PATCH 4/4] xfs_scrub_all: failure reporting for the xfs_scrub_all job From: "Darrick J. Wong" To: sandeen@sandeen.net, darrick.wong@oracle.com Cc: linux-xfs@vger.kernel.org Date: Tue, 31 Dec 2019 17:23:07 -0800 Message-ID: <157784178791.1372453.1791394612520677285.stgit@magnolia> In-Reply-To: <157784176039.1372453.10128269126585047352.stgit@magnolia> References: <157784176039.1372453.10128269126585047352.stgit@magnolia> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=9 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010011 X-Proofpoint-Virus-Version: vendor=nai engine=6000 definitions=9487 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=9 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1911140001 definitions=main-2001010010 Sender: linux-xfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org From: Darrick J. Wong Create a failure reporting service for when xfs_scrub_all fails. This is probably a debug-only patch. Signed-off-by: Darrick J. Wong --- scrub/Makefile | 3 ++- scrub/xfs_scrub_all_fail | 24 ++++++++++++++++++++++++ scrub/xfs_scrub_all_fail.service.in | 11 +++++++++++ 3 files changed, 37 insertions(+), 1 deletion(-) create mode 100755 scrub/xfs_scrub_all_fail create mode 100644 scrub/xfs_scrub_all_fail.service.in diff --git a/scrub/Makefile b/scrub/Makefile index 47c887eb..50d16121 100644 --- a/scrub/Makefile +++ b/scrub/Makefile @@ -18,7 +18,7 @@ XFS_SCRUB_ALL_PROG = xfs_scrub_all XFS_SCRUB_ARGS = -b -n ifeq ($(HAVE_SYSTEMD),yes) INSTALL_SCRUB += install-systemd -SYSTEMD_SERVICES = xfs_scrub@.service xfs_scrub_all.service xfs_scrub_all.timer xfs_scrub_fail@.service +SYSTEMD_SERVICES = xfs_scrub@.service xfs_scrub_all.service xfs_scrub_all.timer xfs_scrub_fail@.service xfs_scrub_all_fail.service OPTIONAL_TARGETS += $(SYSTEMD_SERVICES) endif ifeq ($(HAVE_CROND),yes) @@ -133,6 +133,7 @@ install-systemd: default $(SYSTEMD_SERVICES) $(INSTALL) -m 644 $(SYSTEMD_SERVICES) $(SYSTEMD_SYSTEM_UNIT_DIR) $(INSTALL) -m 755 -d $(PKG_LIB_DIR)/$(PKG_NAME) $(INSTALL) -m 755 xfs_scrub_fail $(PKG_LIB_DIR)/$(PKG_NAME) + $(INSTALL) -m 755 xfs_scrub_all_fail $(PKG_LIB_DIR)/$(PKG_NAME) install-crond: default $(CRONTABS) $(INSTALL) -m 755 -d $(CROND_DIR) diff --git a/scrub/xfs_scrub_all_fail b/scrub/xfs_scrub_all_fail new file mode 100755 index 00000000..8391abc8 --- /dev/null +++ b/scrub/xfs_scrub_all_fail @@ -0,0 +1,24 @@ +#!/bin/bash + +# Email logs of failed xfs_scrub_all unit runs + +mailer=/usr/sbin/sendmail +recipient="$1" +test -z "${recipient}" && exit 0 +hostname="$(hostname -f 2>/dev/null)" +test -z "${hostname}" && hostname="${HOSTNAME}" +if [ ! -x "${mailer}" ]; then + echo "${mailer}: Mailer program not found." + exit 1 +fi + +(cat << ENDL +To: $1 +From: +Subject: xfs_scrub_all failure on ${mntpoint} + +So sorry, the automatic xfs_scrub_all on ${hostname} failed. + +A log of what happened follows: +ENDL +systemctl status --full --lines 4294967295 "xfs_scrub_all") | "${mailer}" -t -i diff --git a/scrub/xfs_scrub_all_fail.service.in b/scrub/xfs_scrub_all_fail.service.in new file mode 100644 index 00000000..2d85db28 --- /dev/null +++ b/scrub/xfs_scrub_all_fail.service.in @@ -0,0 +1,11 @@ +[Unit] +Description=Online XFS Metadata Check for All Filesystems Failure Reporting for %I +Documentation=man:xfs_scrub_all(8) + +[Service] +Type=oneshot +Environment=EMAIL_ADDR=root +ExecStart=@pkg_lib_dir@/@pkg_name@/xfs_scrub_all_fail "${EMAIL_ADDR}" +User=mail +Group=mail +SupplementaryGroups=systemd-journal