From nobody Mon Jan 30 18:52:04 2023 X-Original-To: dev-commits-ports-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4P5HNN3tcRz3cDqf; Mon, 30 Jan 2023 18:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4P5HNN3PCcz3RKT; Mon, 30 Jan 2023 18:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675104724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XnobnCDzvVbV0UTEWLgZoapm2uwwUES4CQUnB1oyBfg=; b=Kk1kbonbPw+nhlyRjGRMn703ZI1SEZdsoIQL7n/9C8s+Ux1Kmj/p5zEfydRtdqvod9Qinn TrSgBwbtnnQFO2MNrdO90i61n1PP0sVdXIl9EBz7Kwoj8Nqmp7xCncOwf1jlPM86HpGO/U YchYc0kCVvmTghqIwwQM7sTdwml0vNeFezLSC2uZ00LKmFS1EEhEY9rCfObFTqFZ4EAK6H +dbSuScGCkH7ZTfvJCyF4fNc5OmiR8l+KkNm2wPZpOKh+/yMWPfkBspJ4xnWCcbNOG6SeG E8VMDBXwYjTOL/f/n5TyUNJhKRDs+wn5I3kUCljQUbornWtpv9I8yCMqd1CqnQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1675104724; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=XnobnCDzvVbV0UTEWLgZoapm2uwwUES4CQUnB1oyBfg=; b=B8SEiuhp7xpOAHXIG/4Q7TbnN4RZV6BzDgSDmea5p1nl+Lu2cmOlgdrOOWf1NdqTg3wV3v i9b4vTqoIDBXQ0AAZw6sutxSYYkC8rG1qk3pWb4u54I/SySp9gOdS3JlcS9OXAu5qcR5E/ Pw06JgrObMQm39QnfjSI4UXPFcrJ82NlJT5No38lPGvxeP6Sxdxgz6Og7UPk9yXcve0gmT T7znUxL9BApMITCodXm6giKndgPmEUsKt4ZZgOINvxTEDR20YjbVA4kce9MKiMd52n2yyr T7AixY9DjHfKm/4B3C0Tktix7ZPngpYcg556Twn1sHIkWyhngFVKexmTy6puQg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1675104724; a=rsa-sha256; cv=none; b=IKiIiktQPNpETW/b/vGu6dNSiFVXSMa4ur881jx9q0ZO2soYSCDvbKT4nf9pqMwOanRP8S 1nkpsOewJpYL9llYMWOqR2Dy9/qpggLY6qE/HE8aXnRljbfuL1BQawAp9lA/3fbiaH7LpV oCl6K8yEHexKX8iTvjNr9CBG24CPNPCwj3xgfLnWjq9rEM/ISitUMUpl2bm1COSWP1f6Ya 3OUYlHOpMj6UqoN9lOMFDjXVbJ+5UBuBCYc9ib4yhq9bHhU0jfkBcPzQLIF8iFR7MlHHFV BkBsrODJ22qSLqpveVwWVHZ7MwDZZm99kjTFzen8eaVUJd2FR5tebp8mda1WPA== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4P5HNN2SRxzKRJ; Mon, 30 Jan 2023 18:52:04 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 30UIq4SD073601; Mon, 30 Jan 2023 18:52:04 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 30UIq4FG073600; Mon, 30 Jan 2023 18:52:04 GMT (envelope-from git) Date: Mon, 30 Jan 2023 18:52:04 GMT Message-Id: <202301301852.30UIq4FG073600@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Florian Smeets Subject: git: 02388ae491f5 - main - sysutils/munin-{master,node}: change cron job install List-Id: Commit messages for all branches of the ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-all@freebsd.org X-BeenThere: dev-commits-ports-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: flo X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 02388ae491f5d00fb4dfe7e1945b8644c3c1aae7 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by flo: URL: https://cgit.FreeBSD.org/ports/commit/?id=02388ae491f5d00fb4dfe7e1945b8644c3c1aae7 commit 02388ae491f5d00fb4dfe7e1945b8644c3c1aae7 Author: Florian Smeets AuthorDate: 2023-01-29 22:17:24 +0000 Commit: Florian Smeets CommitDate: 2023-01-30 18:46:33 +0000 sysutils/munin-{master,node}: change cron job install Don't rely on directly calling crontab(1) to install the cron job, use the etc/cron.d directory for which we've had support for a while. This fixes installing munin-master using pkg -r as crontab(1) installed the cron job on the host system not in the specified alternative root otherwise. Completely remove pkg-install, that also removes the automatic migration for newsyslog files after src revision r340318 it's been 4 years and a bit. Leave the pkg-deinstall script for a while to make sure that the automatically installed cron jobs via crontab(1) are removed. PR: 258072 Reported by: Tassilo Philipp Tested by: Tassilo Philipp --- sysutils/munin-master/Makefile | 3 + sysutils/munin-master/files/cron | 1 + sysutils/munin-master/files/pkg-message.in | 22 ------- sysutils/munin-master/pkg-install | 100 ----------------------------- sysutils/munin-master/pkg-plist | 2 + sysutils/munin-node/files/pkg-message.in | 19 ------ sysutils/munin-node/pkg-install | 42 ------------ 7 files changed, 6 insertions(+), 183 deletions(-) diff --git a/sysutils/munin-master/Makefile b/sysutils/munin-master/Makefile index 9af9026bd64b..0dc2ad4203a0 100644 --- a/sysutils/munin-master/Makefile +++ b/sysutils/munin-master/Makefile @@ -1,5 +1,6 @@ PORTNAME= munin PORTVERSION= ${MUNIN_VERSION} +PORTREVISION= 1 CATEGORIES= sysutils perl5 MASTER_SITES= ${MUNIN_SITES} PKGNAMESUFFIX= -master @@ -57,5 +58,7 @@ post-install: (cd ${STAGEDIR}${ETCDIR}; for i in `find . -type f`; do mv $$i $$i.sample; done) ${MV} ${STAGEDIR}${WWWDIR}/.htaccess ${STAGEDIR}${WWWDIR}/.htaccess.sample ${INSTALL_DATA} ${FILESDIR}/newsyslog ${STAGEDIR}${ETCDIR}/munin-master.newsyslog + ${MKDIR} ${STAGEDIR}${LOCALBASE}/etc/cron.d + ${INSTALL_DATA} ${FILESDIR}/cron ${STAGEDIR}${ETCDIR}/munin-master.cron .include diff --git a/sysutils/munin-master/files/cron b/sysutils/munin-master/files/cron new file mode 100644 index 000000000000..aaa873114e8b --- /dev/null +++ b/sysutils/munin-master/files/cron @@ -0,0 +1 @@ +*/5 * * * * munin /usr/local/bin/munin-cron diff --git a/sysutils/munin-master/files/pkg-message.in b/sysutils/munin-master/files/pkg-message.in index 5bd0f0a0cc11..1a7d9382f644 100644 --- a/sysutils/munin-master/files/pkg-message.in +++ b/sysutils/munin-master/files/pkg-message.in @@ -8,29 +8,7 @@ Please edit it according to your needs. The Munin server will be run from cron under the user 'munin'. -If you need to customize the munin crontab, remove the lines -containing #BEGIN_MUNIN_MAIN and #END_MUNIN_MAIN, and add a line -with #MANUAL_MUNIN_CRONTAB. EOT type: install } -{ -message: < /dev/null 2>&1 - then - if ! crontab -u munin -l | grep -q MANUAL_MUNIN_CRONTAB - then - TMPFILE=`mktemp -t munin` || exit 1 - cat > $TMPFILE - crontab -u munin -l | sed -e "/^$b$/,/^$e$/d" | \ - cat - $TMPFILE | crontab -u munin - - rm $TMPFILE - fi - else - crontab -u munin - - fi -} - -move_www_dir() { - if [ -d ${PKG_PREFIX}/www/data/munin -a ! -d ${PKG_PREFIX}/www/munin ] - then - echo Migrating ${PKG_PREFIX}/www/data/munin to ${PKG_PREFIX}/www/munin - mv ${PKG_PREFIX}/www/data/munin ${PKG_PREFIX}/www/munin - fi -} - -move_newsyslog_conf() { - oldfile=${PKG_PREFIX}/etc/newsyslog.conf.d/munin-master - newfile=${PKG_PREFIX}/etc/newsyslog.conf.d/munin-master.conf - samplefile=${PKG_PREFIX}/etc/munin/munin-master.newsyslog - if [ -f ${oldfile} ]; then - echo "Configuration file found in old location: ${oldfile}" - if cmp -s ${samplefile} ${newfile} > /dev/null; then - echo "Configuration file in new location has not been modified from the default: ${newfile}" - echo " => Moving old configuration file to new location" - mv -f ${oldfile} ${newfile} - else - echo "Configuration file in new location has been modified from the default: ${newfile}" - echo " => Deleting old configuration file" - rm ${oldfile} - fi - fi -} - -######################################################################## - -case $2 in - PRE-INSTALL) - move_www_dir # at some point in the installation, the www dir is created - ;; - POST-INSTALL) - if [ -z "${PACKAGE_BUILDING}" ] - then - create_crontab_entries '#BEGIN_MUNIN_MAIN' '#END_MUNIN_MAIN' < /dev/null; then - echo "Configuration file in new location has not been modified from the default: ${newfile}" - echo " => Moving old configuration file to new location" - mv -f ${oldfile} ${newfile} - else - echo "Configuration file in new location has been modified from the default: ${newfile}" - echo " => Deleting old configuration file" - rm ${oldfile} - fi - fi -} - -######################################################################## - -case $2 in - POST-INSTALL) - if [ -z "${PACKAGE_BUILDING}" ]; then - init_plugins - fi - move_newsyslog_conf - ;; -esac