From owner-svn-ports-head@freebsd.org Tue Feb 23 10:28:04 2021 Return-Path: Delivered-To: svn-ports-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 8134A566167; Tue, 23 Feb 2021 10:28:04 +0000 (UTC) (envelope-from krion@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 4DlFch3Fg5z4lxb; Tue, 23 Feb 2021 10:28:04 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 580A717B7F; Tue, 23 Feb 2021 10:28:04 +0000 (UTC) (envelope-from krion@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 11NAS407025046; Tue, 23 Feb 2021 10:28:04 GMT (envelope-from krion@FreeBSD.org) Received: (from krion@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 11NAS3mV025041; Tue, 23 Feb 2021 10:28:03 GMT (envelope-from krion@FreeBSD.org) Message-Id: <202102231028.11NAS3mV025041@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: krion set sender to krion@FreeBSD.org using -f From: Kirill Ponomarev Date: Tue, 23 Feb 2021 10:28:03 +0000 (UTC) To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r566387 - in head/sysutils: . cbsd-mq-router cbsd-mq-router/files X-SVN-Group: ports-head X-SVN-Commit-Author: krion X-SVN-Commit-Paths: in head/sysutils: . cbsd-mq-router cbsd-mq-router/files X-SVN-Commit-Revision: 566387 X-SVN-Commit-Repository: ports MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-ports-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the ports tree for head List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 Feb 2021 10:28:04 -0000 Author: krion Date: Tue Feb 23 10:28:03 2021 New Revision: 566387 URL: https://svnweb.freebsd.org/changeset/ports/566387 Log: This port delivers tasks to the CBSD using beanstalkd broker. The service acts as an intermediate link between the broker and the CBSD. PR: 253789 Submitted by: olevole___at___olevole___dot___ru Added: head/sysutils/cbsd-mq-router/ head/sysutils/cbsd-mq-router/Makefile (contents, props changed) head/sysutils/cbsd-mq-router/distinfo (contents, props changed) head/sysutils/cbsd-mq-router/files/ head/sysutils/cbsd-mq-router/files/cbsd-mq-router.in (contents, props changed) head/sysutils/cbsd-mq-router/pkg-descr (contents, props changed) Modified: head/sysutils/Makefile Modified: head/sysutils/Makefile ============================================================================== --- head/sysutils/Makefile Tue Feb 23 10:03:56 2021 (r566386) +++ head/sysutils/Makefile Tue Feb 23 10:28:03 2021 (r566387) @@ -141,6 +141,7 @@ SUBDIR += byobu SUBDIR += catfish SUBDIR += cbsd + SUBDIR += cbsd-mq-router SUBDIR += ccd2iso SUBDIR += cciss_vol_status SUBDIR += ccze Added: head/sysutils/cbsd-mq-router/Makefile ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cbsd-mq-router/Makefile Tue Feb 23 10:28:03 2021 (r566387) @@ -0,0 +1,37 @@ +# $FreeBSD$ + +PORTNAME= cbsd-mq-router +PORTVERSION= 0.1 +CATEGORIES= sysutils + +MAINTAINER= olevole@olevole.ru +COMMENT= CBSD message queue router + +LICENSE= BSD2CLAUSE + +RUN_DEPENDS= beanstalkd:net/beanstalkd + +USES= go + +USE_GITHUB= yes +GH_TAGNAME= 1605df2 +GH_ACCOUNT= cbsd +GH_PROJECT= cbsd-mq-router +USE_RC_SUBR= cbsd-mq-router + +PLIST_FILES= bin/cbsd-mq-router "@sample etc/cbsd-mq-router.json.sample" + +GH_TUPLE= beanstalkd:go-beanstalk:3bed00be7a17:beanstalkd/src/github.com/beanstalkd/go-beanstalk \ + golang:crypto:5ea612d1eb83:golang_crypto/vendor/golang.org/x/crypto \ + golang:term:6a3ed077a48d:golang_term/vendor/golang.org/x/term \ + golang:sys:9a76102bfb43:golang_sys/vendor/golang.org/x/sys + +post-extract: + ${LN} -sf ${WRKSRC}/src ${WRKDIR} + ${LN} -sf ${WRKSRC} ${WRKDIR}/src/${PORTNAME} + +do-install: + ${INSTALL_PROGRAM} ${WRKDIR}/bin/${PORTNAME} ${STAGEDIR}${PREFIX}/bin/cbsd-mq-router + ${INSTALL_DATA} ${WRKDIR}/${PORTNAME}-${GH_TAGNAME}/etc/cbsd-mq-router.json ${STAGEDIR}${PREFIX}/etc/cbsd-mq-router.json.sample + +.include Added: head/sysutils/cbsd-mq-router/distinfo ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cbsd-mq-router/distinfo Tue Feb 23 10:28:03 2021 (r566387) @@ -0,0 +1,11 @@ +TIMESTAMP = 1614070067 +SHA256 (cbsd-cbsd-mq-router-0.1-1605df2_GH0.tar.gz) = 2671686dc5764b27d6d8ccb9a4375026fd1e3cba7c53d1a5c3947da101d89ec8 +SIZE (cbsd-cbsd-mq-router-0.1-1605df2_GH0.tar.gz) = 6970 +SHA256 (beanstalkd-go-beanstalk-3bed00be7a17_GH0.tar.gz) = 4efb9667cadd4945ec54ccc3caa824ab7fb06f75f8b234c1899c4664dc718bb7 +SIZE (beanstalkd-go-beanstalk-3bed00be7a17_GH0.tar.gz) = 8063 +SHA256 (golang-crypto-5ea612d1eb83_GH0.tar.gz) = ab4d88d6121195632d006705a950adebaf4fa99dd15ea0c508297a17c5d3277e +SIZE (golang-crypto-5ea612d1eb83_GH0.tar.gz) = 1726242 +SHA256 (golang-term-6a3ed077a48d_GH0.tar.gz) = 6760076add528b90a5e07ad357eef6f11ec03e19eebe66d1b1ef383fd9214e9a +SIZE (golang-term-6a3ed077a48d_GH0.tar.gz) = 15333 +SHA256 (golang-sys-9a76102bfb43_GH0.tar.gz) = 5bbc9c4e02f8ffa73c0f1baa3d0cbd4fc987b5daf08373f669673b8d651afb1b +SIZE (golang-sys-9a76102bfb43_GH0.tar.gz) = 1115608 Added: head/sysutils/cbsd-mq-router/files/cbsd-mq-router.in ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cbsd-mq-router/files/cbsd-mq-router.in Tue Feb 23 10:28:03 2021 (r566387) @@ -0,0 +1,75 @@ +#!/bin/sh + +# PROVIDE: cbsd_mq_router +# REQUIRE: NETWORK +# BEFORE: DAEMON + +. /etc/rc.subr + +name="cbsd_mq_router" +desc="CBSD message queue router" +rcvar="cbsd_mq_router_enable" +pidfile="/var/run/${name}.pid" +daemon_pidfile="/var/run/${name}-daemon.pid" +logdir="/var/log/${name}" +logfile="${logdir}/cbsd_mq_router.log" +extra_commands="reload" +command="%%PREFIX%%/bin/cbsd-mq-router" +cbsd_mq_router_config=${cbsd_mq_router_config-"%%PREFIX%%/etc/cbsd-mq-router.json"} +required_files="${cbsd_mq_router_config}" + +cbsd_mq_router_args=${cbsd_mq_router_args-"-config ${cbsd_mq_router_config}"} + +load_rc_config ${name} + +start_cmd="start" +stop_cmd="stop" +status_cmd="status" +reload_cmd="reload" + +stop() +{ + if [ -f "${daemon_pidfile}" ]; then + pids=$( pgrep -F ${daemon_pidfile} 2>&1 ) + _err=$? + [ ${_err} -eq 0 ] && kill -9 ${pids} && /bin/rm -f ${daemon_pidfile} + fi + if [ -f "${pidfile}" ]; then + pids=$( pgrep -F ${pidfile} 2>&1 ) + _err=$? + [ ${_err} -eq 0 ] && kill -9 ${pids} && /bin/rm -f ${pidfile} + fi +} + +start() +{ + [ ! -d ${logdir} ] && mkdir -p ${logdir} + touch ${logfile} + /usr/sbin/daemon -f -R5 -p ${pidfile} -P ${daemon_pidfile} -o ${logfile} ${command} ${cbsd_mq_router_args} +} + +reload() +{ + stop + start +} + +status() +{ + if [ -f "${pidfile}" ]; then + pids=$( pgrep -F ${pidfile} 2>&1 ) + _err=$? + if [ ${_err} -eq 0 ]; then + echo "${name} is running as pid ${pids}" + exit 0 + else + echo "wrong pid: ${pids}" + exit 1 + fi + else + echo "no pidfile $pidfile" + exit 1 + fi +} + +run_rc_command "$1" Added: head/sysutils/cbsd-mq-router/pkg-descr ============================================================================== --- /dev/null 00:00:00 1970 (empty, because file is newly added) +++ head/sysutils/cbsd-mq-router/pkg-descr Tue Feb 23 10:28:03 2021 (r566387) @@ -0,0 +1,4 @@ +Deliver tasks to the CBSD using beanstalkd broker. The service +acts as an intermediate link between the broker and the CBSD. + +WWW: https://github.com/cbsd/cbsd-mq-router