From nobody Mon Jan 02 23:18:59 2023 X-Original-To: dev-commits-ports-main@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 4NmBdH4bnyz2njb2; Mon, 2 Jan 2023 23:18:59 +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 4NmBdH43lSz4KSQ; Mon, 2 Jan 2023 23:18:59 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672701539; 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=NmCvPWSnD65SrsS2xDp/M+vH57GHwONVl+nC+ONe6qY=; b=e7NsFInUDzBnVCbO0q9IPtjttTpVF9vXwZRxclY4nDmpd2j3TAaF5+BFJ4PgosqNu8H5xL qHch4BSENZA3eS4VXFB03rQC7UEmau4dP4Jhssy+r2zOOiqyYq4oYeWXnbSJZNtiaKZi0z CRbf8S3RSFx7oUTQQXDDvLNMKbPOkSGyhSJ/RNDOuJ2gUyAQrYH/nl5BVjNH0sFruCxs62 sU+c4DYbmHHFwPMf4PJlYg0y0TgS+5IRVRX41Pl+xGkfIlBJpL1Vupo8BK3eYOYUSwnB0M sfCNz6N5aB5gjqicic2F9bDCWRumAil03QmTRFY3OMhJ2q+kEwDTc0h8QVUSpg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1672701539; 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=NmCvPWSnD65SrsS2xDp/M+vH57GHwONVl+nC+ONe6qY=; b=QeNvfvNYrYyuwTlk6mPGAnSlpf4B9PHvF/S5DZNzaHXCpJDjpbNmzIFnaeDDwfQjsXBGW+ c1BxE/3azHOngyO8+eYPNALIFJJD2lpNSg0vixZbzV1bjdwRU9zMBQ4YZEI8ZRR7V68e2n wcO5gijs2UJZL+GdQsTqibuJHtBV+TukT0cH1kMTu+QLE1C5aTvcJ1NbFUnafzI4OqzvM0 xautY8Aq1gg6EYo2sAna1cwM09kDg3N/sv9DNYYxlYea5UrH0ykHGkWGzWeavYol3TVzVf PKMUCWG5+2d6Xof/j/V0tYIk7HCWED1nbJ/XnpffI24Jg1xce/+as7dSf0LyCA== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1672701539; a=rsa-sha256; cv=none; b=Y0+/9JZ52gwhS5fCLfcq2Unm9RvvoZVoEz2VHL7XjTT8WrmzQFtIKIhFSDE6DrUC+OsyTX xj0cLpSMUvnJqGr9Vw5cbOLFq517hDsEfhx2nSKuZWMwOJkb/D2eGYZGN8Bu4VnFP4DSR9 mOVC+Xtir4Vlpn/vf0XjxzKQn//KsqigpeH6Pl+3HlFATCWXvVdze1E9F8osayXNyebRqM P8DDOSToh/7r9i1ZePxu5k0Q/OkkXJLHVmc2AMbCuscPP/fsCgmQX8m7X6X8bhGg3z5od6 04NGB2XxvTkp0shLru94CHaRJIfjfIK/S6YsAGBN7IUIfyyuB3tMYNl3k8BGaQ== 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 4NmBdH2tvgz1PL5; Mon, 2 Jan 2023 23:18:59 +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 302NIxJd016926; Mon, 2 Jan 2023 23:18:59 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 302NIx5F016925; Mon, 2 Jan 2023 23:18:59 GMT (envelope-from git) Date: Mon, 2 Jan 2023 23:18:59 GMT Message-Id: <202301022318.302NIx5F016925@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Olivier Cochard Subject: git: 0f166ee9896b - main - net/tcplog_dumper: Add a RC script List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: olivier X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 0f166ee9896b4f6ab6b311fb716f64819f729745 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by olivier: URL: https://cgit.FreeBSD.org/ports/commit/?id=0f166ee9896b4f6ab6b311fb716f64819f729745 commit 0f166ee9896b4f6ab6b311fb716f64819f729745 Author: Olivier Cochard AuthorDate: 2023-01-02 23:16:27 +0000 Commit: Olivier Cochard CommitDate: 2023-01-02 23:18:10 +0000 net/tcplog_dumper: Add a RC script Obtained from: tuexen Sponsored by: Netflix --- net/tcplog_dumper/Makefile | 3 +++ net/tcplog_dumper/files/tcplog_dumper.in | 44 ++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/net/tcplog_dumper/Makefile b/net/tcplog_dumper/Makefile index 4a41b420a801..261db29afb77 100644 --- a/net/tcplog_dumper/Makefile +++ b/net/tcplog_dumper/Makefile @@ -1,6 +1,7 @@ PORTNAME= tcplog_dumper PORTVERSION= 0.1.1 DISTVERSIONPREFIX= v +PORTREVISION= 1 CATEGORIES= net MAINTAINER= olivier@FreeBSD.org @@ -16,6 +17,8 @@ ONLY_FOR_ARCHS_REASON= only 64-bit platforms are supported USE_GITHUB= yes GH_ACCOUNT= Netflix +USE_RC_SUBR= tcplog_dumper + PLIST_FILES= sbin/tcplog_dumper \ man/man1/tcplog_dumper.1.gz diff --git a/net/tcplog_dumper/files/tcplog_dumper.in b/net/tcplog_dumper/files/tcplog_dumper.in new file mode 100644 index 000000000000..ccab36820af8 --- /dev/null +++ b/net/tcplog_dumper/files/tcplog_dumper.in @@ -0,0 +1,44 @@ +#!/bin/sh + +# PROVIDE: tcplog_dumper +# REQUIRE: DAEMON +# KEYWORD: shutdown + +# Add the following lines to /etc/rc.conf.local or /etc/rc.conf +# to enable this service: +# +# tcplog_dumper_enable (bool): Set to NO by default. +# Set it to YES to enable tcplog_dumper. +# tcplog_dumper_pidfile (file): Set to /var/run/tcplog_dumper.pid by default. +# tcplog_dumper_basedir (path): Set to /var/log/tcplog_dumps by default. +# tcplog_dumper_basedir_owner: Set to nobody by default. + +. /etc/rc.subr + +name=tcplog_dumper +rcvar=tcplog_dumper_enable + +load_rc_config ${name} + +: ${tcplog_dumper_enable:=NO} +: ${tcplog_dumper_pidfile=/var/run/${name}.pid} +: ${tcplog_dumper_basedir=/var/log/tcplog_dumps} +: ${tcplog_dumper_basedir_owner=nobody} + +command="%%PREFIX%%/sbin/${name}" +command_args="-d -D ${tcplog_dumper_basedir} -u ${tcplog_dumper_basedir_owner} -p ${tcplog_dumper_pidfile}" + +pidfile="${tcplog_dumper_pidfile}" +start_precmd="${name}_prestart" + +tcplog_dumper_prestart() +{ + if [ ! -d "${tcplog_dumper_basedir}" ]; then + mkdir -p "${tcplog_dumper_basedir}" + fi + if [ ! "x$(stat -f '%Su' ${tcplog_dumper_basedir})" = "x${tcplog_dumper_basedir_owner}" ] ; then + chown "${tcplog_dumper_basedir_owner}" "${tcplog_dumper_basedir}" + fi +} + +run_rc_command "$1"