From patchwork Thu May 6 19:46:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Sunke X-Patchwork-Id: 4247 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FbkcC74ngz44RY for ; Thu, 6 May 2021 19:46:51 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4Fbkc951vHz2RX; Thu, 6 May 2021 19:46:49 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4Fbkc913vTz2ylN; Thu, 6 May 2021 19:46:49 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Fbkc832hMz2xCN for ; Thu, 6 May 2021 19:46:48 +0000 (UTC) Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4Fbkc80wCzzjb for ; Thu, 6 May 2021 19:46:48 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout01.posteo.de (Postfix) with ESMTPS id C3FFC24002B for ; Thu, 6 May 2021 21:46:47 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1620330407; bh=LzGY56HLEAZU63iqd2VEDZjd5fsQetQ09v40Px5dn2E=; h=From:To:Cc:Subject:Date:From; b=qY6SlmnFyPiplddYhDYUuLus3PXBFqA/wHGSH94vUtVfp4gVLwu0/7Jt/CLbdxDv8 jHynHBmo6fRffsx40a2NxHzYL1Lek/uFQlUBP7a0+HgGwfH44upYjbgyE6jWdxX85s tU6OP9wCcuMjIEDbmB3vxqK3ERUKRUnrIg+zCXpRzATv9RzOQBVmr1LnZZPDnL0lGf rIGkI9W+UZ1z2WENjRuxQJVOtFUkrAtiFXNRTCUjCjy7udBdfNXrjFo71ZotqFwbtz DpY2YXTYRrkNvFdm8L0PpMuESbmnFTeHlPzNxurb8oboM9Hroa+ITR+aTXTrT83FoI 5D5NhyShh8+gg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fbkc73p5rz9rxG; Thu, 6 May 2021 21:46:47 +0200 (CEST) From: Holger Sunke To: development@lists.ipfire.org Subject: [PATCH 1/2] Added i586/386 support for GO language required for node_exporter. Date: Thu, 6 May 2021 19:46:15 +0000 Message-Id: <20210506194616.2972714-2-holger.sunke@posteo.de> In-Reply-To: <20210506194616.2972714-1-holger.sunke@posteo.de> References: <20210506194616.2972714-1-holger.sunke@posteo.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=qY6SlmnF; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.65 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1620330408; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=MkXIMnom0K78v4NtDlmzGAhm1kOPBcCVbrNVvGBJXEw=; b=HZNW2VpBZ0lEdnSfgzvtMGOGsNC+G7zl6+vdLw5g4f0zYwRaP0TUVYExWq1r32PqJAMIP0 a3P3hww27DZXiJyJW8Y3SwoBk8HcoygqfFWsouyHQw6aoreBAf0ZpftckeZx6gRkIuzu5W NaMvLKaf9cJaIb7DIRe9H/S/5TMIlUDmehyeqHzOS9OpPs2OSiCwFtFo726hwTdsOL6EHR uMAMtKwDtj5lzuDXx0/JUuJuC45xQdIwena8tBsVT2KDTVu0Xc1Jbks/uKq/QuBJHaGZqK XiG6t9IM0gdXoudhPc68BOZ7IlIbaHVcmYt1I2IUTNNfxGf0vh9jzVy6+gs2jw== ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1620330408; a=rsa-sha256; cv=none; b=hLDWhrDvjFKwt3mulCfJR2Yr2YzInQ9VztJTercFXIebi7xw9rz4lpa9FEdwnXDTxXYph8 37NQXxJxlW+NpjmFpPgseWiQ5Ivhng+yj+y257gpUuJ1DDIZFM/6NxBXeekQAXD0uFronB h9MFwnfrkGzvb7YP+9EpPv1KMNfeOworZ/eKlVjq6/9iXCQw/PAQ+Z4V02KApA6QedFNW1 fvVmMyrp9SumVLlAdF1qApWzI54KNMTSc9Ap0cs2zs93UfetLirEGPa8B29ouiyoVw6+27 f7ACc2gvYyfJsMA6umnu1ez50Gs/5e4G/8mU7RTRVz8dVqGrmf+MCzgZduI3Aw== Authentication-Results: mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=qY6SlmnF; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.65 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-0.72 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.67.36.0/23:c]; R_MISSING_CHARSET(2.50)[]; RWL_MAILSPIKE_GOOD(0.00)[185.67.36.65:from]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; IP_REPUTATION_HAM(-0.01)[asn: 8495(0.00), country: DE(-0.01), ip: 185.67.36.65(0.00)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[posteo.de:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[posteo.de,none]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.65:from]; MX_GOOD(-0.01)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; BAYES_HAM(-3.00)[99.99%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[posteo.de:s=2017]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; DWL_DNSWL_LOW(-1.00)[posteo.de:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4Fbkc80wCzzjb X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" --- lfs/Config | 4 ++++ lfs/go | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/lfs/Config b/lfs/Config index eadbbc408..4d0f2f00b 100644 --- a/lfs/Config +++ b/lfs/Config @@ -138,6 +138,10 @@ ifeq "$(BUILD_ARCH)" "aarch64" GOARCH = arm64 endif +ifeq "$(BUILD_ARCH)" "i586" + GOARCH = 386 +endif + ############################################################################### # Common Macro Definitions ############################################################################### diff --git a/lfs/go b/lfs/go index 6ebb37080..97effcb84 100644 --- a/lfs/go +++ b/lfs/go @@ -28,10 +28,9 @@ VER = 1.15.4 THISAPP = go-$(VER) DL_FILE = go$(VER).$(GOOS)-$(GOARCH).tar.gz -DL_FROM = $(URL_IPFIRE) +DL_FROM = https://golang.org/dl/ DIR_APP = $(DIR_SRC)/go TARGET = $(DIR_INFO)/$(THISAPP) -SUP_ARCH = x86_64 ############################################################################### # Top-level Rules @@ -41,7 +40,8 @@ objects = $(DL_FILE) $(DL_FILE) = $(DL_FROM)/$(DL_FILE) -$(DL_FILE)_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-amd64.tar.gz_MD5 = 8e9d11a16f03372c82c5134278a0bd7d +go$(VER).$(GOOS)-386.tar.gz_MD5 = 8d1c3539c88710273f61b0c810b7448c install : $(TARGET) From patchwork Thu May 6 19:46:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Holger Sunke X-Patchwork-Id: 4248 Return-Path: Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by web04.haj.ipfire.org (Postfix) with ESMTPS id 4FbkcD6Br1z44Rl for ; Thu, 6 May 2021 19:46:52 +0000 (UTC) Received: from mail02.haj.ipfire.org (mail02.haj.ipfire.org [172.28.1.201]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail02.haj.ipfire.org", Issuer "R3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id 4FbkcC2Clqz2Cf; Thu, 6 May 2021 19:46:51 +0000 (UTC) Received: from mail02.haj.ipfire.org (localhost [127.0.0.1]) by mail02.haj.ipfire.org (Postfix) with ESMTP id 4FbkcC1tCBz2yd2; Thu, 6 May 2021 19:46:51 +0000 (UTC) Received: from mail01.ipfire.org (mail01.haj.ipfire.org [172.28.1.202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384) client-signature ECDSA (P-384)) (Client CN "mail01.haj.ipfire.org", Issuer "R3" (verified OK)) by mail02.haj.ipfire.org (Postfix) with ESMTPS id 4Fbkc96QmRz2xX7 for ; Thu, 6 May 2021 19:46:49 +0000 (UTC) Received: from mout02.posteo.de (mout02.posteo.de [185.67.36.66]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-384)) (Client did not present a certificate) by mail01.ipfire.org (Postfix) with ESMTPS id 4Fbkc92Nf7zjb for ; Thu, 6 May 2021 19:46:49 +0000 (UTC) Received: from submission (posteo.de [89.146.220.130]) by mout02.posteo.de (Postfix) with ESMTPS id B7A4C2400FC for ; Thu, 6 May 2021 21:46:48 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1620330408; bh=+suBX3YbrQs0VtHtIJZMu1EOGIk9zAOG9lv+rGyk9gQ=; h=From:To:Cc:Subject:Date:From; b=LQf+IUmMVAbjcwswOoMQDABWJToFAwFVAu+6WiEGtFi/eGevDuW13bjCOqJ69N1Xk CRxZvgHp7W2ebAYTMtt6MpqlsPV1j3sFhok0AW1KrLfoHdfSv5GBrYt/VSuEakWigl yfRfvdhUJ60VfyOnEYIEpW+CL/x7WBGBl0eudK5EylqxxU0dMr+4EUQHl9sg2/VkvS Zf3r89iQoEV6TrB/qwBSE2ChEGD38DmpidVBA7ezkkp9/pY3CFyfmwaLhEeQ3xyYTO XQiTUtxYepW106csR/x569cVbAMe34estM0KjSzlRfuFDasSVuw62qfNVOKz0TnUsY eDRD2yKt4Kucg== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Fbkc83TZdz9rxG; Thu, 6 May 2021 21:46:48 +0200 (CEST) From: Holger Sunke To: development@lists.ipfire.org Subject: [PATCH 2/2] Added new node_exporter package. Date: Thu, 6 May 2021 19:46:16 +0000 Message-Id: <20210506194616.2972714-3-holger.sunke@posteo.de> In-Reply-To: <20210506194616.2972714-1-holger.sunke@posteo.de> References: <20210506194616.2972714-1-holger.sunke@posteo.de> MIME-Version: 1.0 ARC-Authentication-Results: i=1; mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=LQf+IUmM; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.66 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=lists.ipfire.org; s=202003rsa; t=1620330409; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=rs7JTmgnzdz1VJkJotp1XHtXtRConTF8C9W45E7H88s=; b=uAV+/aXYeF/JWLMJYBOSorDec/xESJ7wSdZTXJq9q41+1v0hE45VP4VqOQCSw3anN7k6D8 5/Rjp82oGecasiWtMtYvDD5pvUCmIx6lIIaKDsOGk6TQQZ+iS/K88TvxCZRFFCoM0iV8L4 5qQDlNiDmKeNOU8BbRQFFnnuxnZspUu1COXNl0exlAWj0HhhNQ6wDKfYQ4mffpQ5ULGiTR qjd5isGVsUBqu4emjNIW1smAiucKUAa/WpMlXeaOX97a0t7WSXc4aHM2U5lAitsecg08iE BPwliYsG3RXS7t7InSnh48fW3xiD4zUhO6ypBGAy2CfreJQG59QPeMwAQaxhmQ== ARC-Seal: i=1; s=202003rsa; d=lists.ipfire.org; t=1620330409; a=rsa-sha256; cv=none; b=bj5AtMdwRWg/CtzNL/YNXT5ifPt46yV8pi003xm3nu6NKSOV2u85WGaGuts0XF+yDUP6l5 hm6U1SkcG0345ra4sQLrXYlF50IrUQY5lFZP+ssuqn6kdgD+jjmbevClaXOoOIsytuxeG/ /wuMHrVrufhYpkuLx1Xsu1wvO433qEkH1klj2Ajd1YJXEf1Sruc1paDE8s8GL/Zlr/eV7C 0/DHAr70rsBZF35q74PHuZECwPMW/QIBtITaWQKhME+Gtt0k1mFLnh74f1RDqTO3iPY+Od Yed3gIYubr4FXlN2G5NFB2s7J8zGmMsABYa+JkjYirLlR25yHt2aSHBq/pEnHQ== Authentication-Results: mail01.ipfire.org; dkim=pass header.d=posteo.de header.s=2017 header.b=LQf+IUmM; dmarc=pass (policy=none) header.from=posteo.de; spf=pass (mail01.ipfire.org: domain of holger.sunke@posteo.de designates 185.67.36.66 as permitted sender) smtp.mailfrom=holger.sunke@posteo.de X-Rspamd-Server: mail01.haj.ipfire.org X-Spamd-Result: default: False [-0.72 / 11.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:185.67.36.0/23:c]; R_MISSING_CHARSET(2.50)[]; ARC_SIGNED(0.00)[lists.ipfire.org:s=202003rsa:i=1]; BROKEN_CONTENT_TYPE(1.50)[]; RCVD_DKIM_ARC_DNSWL_MED(-0.50)[]; IP_REPUTATION_HAM(-0.01)[asn: 8495(0.00), country: DE(-0.01), ip: 185.67.36.66(0.00)]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[posteo.de:+]; RCPT_COUNT_TWO(0.00)[2]; DMARC_POLICY_ALLOW(-0.50)[posteo.de,none]; RCVD_IN_DNSWL_MED(-0.20)[185.67.36.66:from]; MX_GOOD(-0.01)[]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8495, ipnet:185.67.36.0/23, country:DE]; BAYES_HAM(-3.00)[99.99%]; ARC_NA(0.00)[]; R_DKIM_ALLOW(-0.20)[posteo.de:s=2017]; FROM_HAS_DN(0.00)[]; MIME_GOOD(-0.10)[text/plain]; PREVIOUSLY_DELIVERED(0.00)[development@lists.ipfire.org]; DWL_DNSWL_LOW(-1.00)[posteo.de:dkim]; TO_MATCH_ENVRCPT_SOME(0.00)[]; MID_CONTAINS_FROM(1.00)[]; RWL_MAILSPIKE_VERYGOOD(0.00)[185.67.36.66:from]; RCVD_TLS_ALL(0.00)[] X-Rspamd-Queue-Id: 4Fbkc92Nf7zjb X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: IPFire development talk List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: development-bounces@lists.ipfire.org Sender: "Development" --- config/rootfiles/packages/node_exporter | 3 + lfs/node_exporter | 88 +++++++++++++++++++ make.sh | 1 + src/paks/node_exporter/install.sh | 31 +++++++ src/paks/node_exporter/uninstall.sh | 30 +++++++ src/paks/node_exporter/update.sh | 27 ++++++ ..._exporter-configurable-initd-options.patch | 48 ++++++++++ 7 files changed, 228 insertions(+) create mode 100644 config/rootfiles/packages/node_exporter create mode 100644 lfs/node_exporter create mode 100644 src/paks/node_exporter/install.sh create mode 100644 src/paks/node_exporter/uninstall.sh create mode 100644 src/paks/node_exporter/update.sh create mode 100644 src/patches/node_exporter-configurable-initd-options.patch diff --git a/config/rootfiles/packages/node_exporter b/config/rootfiles/packages/node_exporter new file mode 100644 index 000000000..20ec55174 --- /dev/null +++ b/config/rootfiles/packages/node_exporter @@ -0,0 +1,3 @@ +usr/bin/node_exporter +etc/node_exporter +etc/rc.d/init.d/node_exporter diff --git a/lfs/node_exporter b/lfs/node_exporter new file mode 100644 index 000000000..3bb4db60e --- /dev/null +++ b/lfs/node_exporter @@ -0,0 +1,88 @@ +############################################################################## +# # +# IPFire.org - A linux based firewall # +# Copyright (C) 2007 Michael Tremer & Christian Schmidt # +# # +# This program is free software: you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation, either version 3 of the License, or # +# (at your option) any later version. # +# # +# This program is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with this program. If not, see . # +# # +############################################################################### + +############################################################################### +# Definitions +############################################################################### + +include Config + +VER = 1.1.2 + +THISAPP = node_exporter-$(VER) +DL_FILE = $(THISAPP).tar.gz +#DL_FROM = https://github.com/prometheus/node_exporter/archive/refs/tags/v1.1.2.tar.gz +DL_FROM = https://github.com/prometheus/node_exporter/archive/v$(VER)/ +DIR_APP = $(DIR_SRC)/$(THISAPP) +TARGET = $(DIR_INFO)/$(THISAPP) +PROG = node_exporter +PAK_VER = 1 + +DEPS = "" + +############################################################################### +# Top-level Rules +############################################################################### + +objects = $(DL_FILE) + +$(DL_FILE) = $(DL_FROM)/$(DL_FILE) + +$(DL_FILE)_MD5 = 33c2be846dbd502f9c0efab149a8cbc5 + +install : $(TARGET) +check : $(patsubst %,$(DIR_CHK)/%,$(objects)) + +download : $(patsubst %,$(DIR_DL)/%,$(objects)) + +md5 : $(subst %,%_MD5,$(objects)) + +dist : + @$(PAK) + +############################################################################### +# Downloading, checking, md5sum +############################################################################### + +$(patsubst %,$(DIR_CHK)/%,$(objects)) : + @$(CHECK) + +$(patsubst %,$(DIR_DL)/%,$(objects)) : + @$(LOAD) + +$(subst %,%_MD5,$(objects)) : + @$(MD5) + +############################################################################### +# Installation Details +############################################################################### + +$(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) + @$(PREBUILD) + @rm -rf $(DIR_APP) && cd $(DIR_SRC) && tar zxf $(DIR_DL)/$(DL_FILE) + cd $(DIR_APP) && patch -Np1 -i $(DIR_SRC)/src/patches/node_exporter-configurable-initd-options.patch + cd $(DIR_APP) && make build $(MAKETUNING) $(EXTRA_MAKE) + cd $(DIR_APP) && cp node_exporter /usr/bin + cd $(DIR_APP) && cp examples/init.d/node_exporter /etc/init.d/ + echo '# Customize node_exporter command line options by editing OPTIONS below:' > /etc/node_exporter + echo 'export OPTIONS="--web.listen-address=:9100"' >> /etc/node_exporter + @rm -rf $(DIR_APP) + @$(POSTBUILD) + diff --git a/make.sh b/make.sh index 2da3aca21..df2995ec5 100755 --- a/make.sh +++ b/make.sh @@ -1640,6 +1640,7 @@ buildipfire() { lfsmake2 ncdu lfsmake2 lshw lfsmake2 socat + lfsmake2 node_exporter } buildinstaller() { diff --git a/src/paks/node_exporter/install.sh b/src/paks/node_exporter/install.sh new file mode 100644 index 000000000..e9272d7cb --- /dev/null +++ b/src/paks/node_exporter/install.sh @@ -0,0 +1,31 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_files +restore_backup ${NAME} +start_service --background ${NAME} + +ln -svf ../init.d/node_exporter /etc/rc.d/rc0.d/K30node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc3.d/S40node_exporter +ln -svf ../init.d/node_exporter /etc/rc.d/rc6.d/K30node_exporter diff --git a/src/paks/node_exporter/uninstall.sh b/src/paks/node_exporter/uninstall.sh new file mode 100644 index 000000000..710baf8b4 --- /dev/null +++ b/src/paks/node_exporter/uninstall.sh @@ -0,0 +1,30 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +/etc/init.d/node_exporter stop +make_backup ${NAME} +remove_files + +rm -rfv /etc/rc.d/rc*.d/*node_exporter + diff --git a/src/paks/node_exporter/update.sh b/src/paks/node_exporter/update.sh new file mode 100644 index 000000000..99776659c --- /dev/null +++ b/src/paks/node_exporter/update.sh @@ -0,0 +1,27 @@ +#!/bin/bash +############################################################################ +# # +# This file is part of the IPFire Firewall. # +# # +# IPFire is free software; you can redistribute it and/or modify # +# it under the terms of the GNU General Public License as published by # +# the Free Software Foundation; either version 2 of the License, or # +# (at your option) any later version. # +# # +# IPFire is distributed in the hope that it will be useful, # +# but WITHOUT ANY WARRANTY; without even the implied warranty of # +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # +# GNU General Public License for more details. # +# # +# You should have received a copy of the GNU General Public License # +# along with IPFire; if not, write to the Free Software # +# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # +# # +# Copyright (C) 2007-2020 IPFire-Team . # +# # +############################################################################ +# +. /opt/pakfire/lib/functions.sh +extract_backup_includes +./uninstall.sh +./install.sh diff --git a/src/patches/node_exporter-configurable-initd-options.patch b/src/patches/node_exporter-configurable-initd-options.patch new file mode 100644 index 000000000..9f662f918 --- /dev/null +++ b/src/patches/node_exporter-configurable-initd-options.patch @@ -0,0 +1,48 @@ +diff -Nur node_exporter-1.1.2.orig/examples/init.d/node_exporter node_exporter-1.1.2/examples/init.d/node_exporter +--- node_exporter-1.1.2.orig/examples/init.d/node_exporter 2021-03-05 10:27:11.000000000 +0100 ++++ node_exporter-1.1.2/examples/init.d/node_exporter 2021-05-04 14:45:20.644729176 +0200 +@@ -2,9 +2,11 @@ + + RETVAL=0 + PROG="node_exporter" +-EXEC="/etc/node_exporter/node_exporter" ++EXEC="/usr/bin/node_exporter" + LOCKFILE="/var/lock/subsys/$PROG" +-OPTIONS="--web.listen-address=:9100" ++ ++# read configurable OPTIONS ++. /etc/node_exporter + + # Source function library. + if [ -f /etc/rc.d/init.d/functions ]; then +@@ -22,18 +24,16 @@ + echo -n "Starting $PROG: " + nohup $EXEC $OPTIONS >/dev/null 2>&1 & + RETVAL=$? +- [ $RETVAL -eq 0 ] && touch $LOCKFILE && success || failure +- echo ++ [ $RETVAL -eq 0 ] && touch $LOCKFILE && echo success || echo failure + return $RETVAL + fi + } + + stop() { + echo -n "Stopping $PROG: " +- killproc $EXEC ++ killproc $EXEC > /dev/null + RETVAL=$? +- [ $RETVAL -eq 0 ] && rm -r $LOCKFILE && success || failure +- echo ++ [ $RETVAL -eq 0 ] && rm -r $LOCKFILE && echo success || echo failure + } + + restart () +@@ -51,7 +51,7 @@ + stop + ;; + status) +- status $PROG ++ statusproc $PROG + ;; + restart) + restart