From patchwork Tue May 8 00:56:49 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Peter_M=C3=BCller?= X-Patchwork-Id: 1758 Return-Path: Received: from mail01.ipfire.org (unknown [172.28.1.200]) by web02.i.ipfire.org (Postfix) with ESMTP id 6FA1860D14 for ; Mon, 7 May 2018 16:57:03 +0200 (CEST) Received: from mail01.i.ipfire.org (localhost [IPv6:::1]) by mail01.ipfire.org (Postfix) with ESMTP id 0D33710F62E5; Mon, 7 May 2018 15:57:03 +0100 (BST) Authentication-Results: mail01.i.ipfire.org; dkim=pass header.d=link38.eu; dmarc=pass (policy=none) header.from=link38.eu; spf=pass smtp.mailfrom=peter.mueller@link38.eu Received: from mx-nbg.link38.eu (mx-nbg.link38.eu [IPv6:2a03:4000:6:432c:1f9e:48:ac3:199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mx-nbg.link38.eu", Issuer "Let's Encrypt Authority X3" (verified OK)) by mail01.ipfire.org (Postfix) with ESMTPS id ECC5410F62E2 for ; Mon, 7 May 2018 15:56:59 +0100 (BST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=link38.eu; s=201803; t=1525705019; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RZWR5R/8WAbM17/7lgfTKHMFzFB4NZW6rvNrotHGtEk=; b=WieKCsXNzXwD+d0DzLWgESfvuzcfCUrTMNU6FqkPyzX5U1an5CFmt0vOJnJfhHAk8iXNbT 8dgzyyQMPHZs0TiAMPAsxZpGjN5OyizIiYEEFFHIjcfw8hKSABnwM/aqpZbiVxZqlCCsJD I6MkgL5LnaHeiI0VimI81zB35hQOsZWyd+MB7VCByFPpTmiBvuNdVWYRw8YBoWUC+/GtCa U4KImHK9bmQLDAwwOB0ZWKWy3JjGcbMOo1b3s5YNyahTIZoJ3sSNdH7facHJyMkeAd8xyq h7d7KxCiK/duIj6Uo079wcHw2fS+4T5lQDkEaRkwtZ3sSzL/XxWRF7NxOC1JhA== Subject: [PATCH v3] install initscript for NRPE From: =?utf-8?q?Peter_M=C3=BCller?= To: Michael Tremer , "IPFire: Development-List" References: <7a4bc1ce-d0b1-edd0-06b0-55ae96bb3530@link38.eu> Openpgp: preference=signencrypt Message-ID: <2d554bc9-64f6-e1dd-d342-41ebe8a7d57e@link38.eu> Date: Mon, 7 May 2018 16:56:49 +0200 MIME-Version: 1.0 In-Reply-To: <7a4bc1ce-d0b1-edd0-06b0-55ae96bb3530@link38.eu> X-Spamd-Result: default: False [-11.63 / 11.00]; ASN(0.00)[asn:197540, ipnet:2a03:4000::/32, country:DE]; DKIM_TRACE(0.00)[link38.eu:+]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FROM_HAS_DN(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a03:4000:6:432c:1f9e:48:ac3:199]; RCPT_COUNT_TWO(0.00)[2]; ARC_NA(0.00)[]; RCVD_TLS_ALL(0.00)[]; FROM_EQ_ENVFROM(0.00)[]; HAS_ATTACHMENT(0.00)[]; DMARC_POLICY_ALLOW(-0.25)[link38.eu,none]; IP_SCORE(-3.77)[ip: (-9.88), ipnet: 2a03:4000::/32(-4.94), asn: 197540(-3.96), country: DE(-0.09)]; MX_GOOD(-0.01)[cached: mx-nbg.link38.eu]; RCVD_COUNT_ZERO(0.00)[0]; BAYES_HAM(-3.00)[100.00%]; MIME_GOOD(-0.20)[multipart/signed,multipart/mixed,text/plain]; R_DKIM_ALLOW(-0.20)[link38.eu]; REPLY(-2.00)[]; MID_RHS_MATCH_FROM(0.00)[]; TO_DN_ALL(0.00)[]; RCVD_IN_DNSWL_MED(-2.00)[9.9.1.0.3.c.a.0.8.4.0.0.e.9.f.1.c.2.3.4.6.0.0.0.0.0.0.4.3.0.a.2.list.dnswl.org : 127.0.6.2] X-Spam-Status: No, score=-11.63 X-Rspamd-Server: mail01.i.ipfire.org X-BeenThere: development@lists.ipfire.org X-Mailman-Version: 2.1.15 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" Install initscript for NRPE addon. The second version of this patch actually includes the initscript, which was missing due to lack of coffee the first time. :-) Thanks to Michael for catching it. Resent due to crappy linewrapping in initscript by MUA. Signed-off-by: Peter Müller --- lfs/nagios_nrpe | 4 ++++ src/initscripts/packages/nrpe | 38 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) create mode 100644 src/initscripts/packages/nrpe +# End $rc_base/init.d/nrpe diff --git a/lfs/nagios_nrpe b/lfs/nagios_nrpe index bebb80144..af37f5076 100644 --- a/lfs/nagios_nrpe +++ b/lfs/nagios_nrpe @@ -90,5 +90,9 @@ $(TARGET) : $(patsubst %,$(DIR_DL)/%,$(objects)) cd $(DIR_APP) && make all $(MAKETUNING) cd $(DIR_APP) && make install cd $(DIR_APP) && make install-config + + #install initscripts + $(call INSTALL_INITSCRIPT,nrpe) + @rm -rf $(DIR_APP) @$(POSTBUILD) diff --git a/src/initscripts/packages/nrpe b/src/initscripts/packages/nrpe new file mode 100644 index 000000000..cd87c1703 --- /dev/null +++ b/src/initscripts/packages/nrpe @@ -0,0 +1,38 @@ +#!/bin/sh +# Begin $rc_base/init.d/nrpe + +. /etc/sysconfig/rc +. $rc_functions + +NRPEBIN=/usr/bin/nrpe +NRPECFG=/etc/nagios/nrpe.cfg + +case "$1" in + start) + boot_mesg "Starting nrpe..." + loadproc $NRPEBIN -c $NRPECFG -d + ;; + + stop) + boot_mesg "Stopping nrpe..." + killproc $NRPEBIN + rm -f /var/run/nrpe.pid + ;; + + restart) + $0 stop + sleep 1 + $0 start + ;; + + status) + statusproc $NRPEBIN + ;; + + *) + echo "Usage: $0 {start|stop|restart|status}" + exit 1 + ;; +esac +