FreeBSD Bugzilla – Attachment 250715 Details for
Bug 239819
[PATCH] net-mgmt/metronome: add rc script
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Add rc.d script, set localhost as default, drop privileges
metronome-0.9.0_21 (text/plain), 4.20 KB, created by
Ralf van der Enden
on 2024-05-17 07:14:16 UTC
(
hide
)
Description:
Add rc.d script, set localhost as default, drop privileges
Filename:
MIME Type:
Creator:
Ralf van der Enden
Created:
2024-05-17 07:14:16 UTC
Size:
4.20 KB
patch
obsolete
>From 375bf41f8e6446f9fd55a885fa9fd2c905c7a174 Mon Sep 17 00:00:00 2001 >From: Ralf van der Enden <tremere@cainites.net> >Date: Wed, 15 May 2024 16:47:39 +0200 >Subject: [PATCH] net-mgmt/metronome: add rc.d script, set localhost as default > address, drop priviliges when starting metronome > >UIDs+GIDs: add _metronome user/group (345) > >PR: 239819 >--- > GIDs | 2 +- > UIDs | 2 +- > net-mgmt/metronome/Makefile | 18 ++++++++++++-- > net-mgmt/metronome/files/metronome.in | 35 +++++++++++++++++++++++++++ > net-mgmt/metronome/pkg-plist | 1 + > 5 files changed, 54 insertions(+), 4 deletions(-) > create mode 100644 net-mgmt/metronome/files/metronome.in > >diff --git a/GIDs b/GIDs >index ea5e397c23..a68dfd3cc5 100644 >--- a/GIDs >+++ b/GIDs >@@ -285,7 +285,7 @@ stunnel:*:341: > openfire:*:342: > gunicorn:*:343: > snmpd:*:344: >-# free: 345 >+_metronome:*:345: > # free: 346 > eturnal:*:347: > # free: 348 >diff --git a/UIDs b/UIDs >index ceba79b7c0..7c31a52724 100644 >--- a/UIDs >+++ b/UIDs >@@ -290,7 +290,7 @@ stunnel:*:341:341::0:0:Stunnel Daemon:/nonexistent:/usr/sbin/nologin > openfire:*:342:342::0:0:Openfire IM Daemon:/nonexistent:/usr/sbin/nologin > gunicorn:*:343:343::0:0:Gunicorn Daemon:/nonexistent:/usr/sbin/nologin > snmpd:*:344:344::0:0:Net-SNMP Daemon:/nonexistent:/usr/sbin/nologin >-# free: 345 >+_metronome:*:345:345::0:0:Metronome Daemon:/nonexistent:/usr/sbin/nologin > # free: 346 > eturnal:*:347:347::0:0:eturnal User:/var/spool/eturnal:/bin/sh > # free: 348 >diff --git a/net-mgmt/metronome/Makefile b/net-mgmt/metronome/Makefile >index 0d43702398..f42f4d0bfa 100644 >--- a/net-mgmt/metronome/Makefile >+++ b/net-mgmt/metronome/Makefile >@@ -1,6 +1,6 @@ > PORTNAME= metronome > DISTVERSION= 0.9.0 >-PORTREVISION= 20 >+PORTREVISION= 21 > CATEGORIES= net-mgmt dns > > MAINTAINER= krion@FreeBSD.org >@@ -13,21 +13,35 @@ LICENSE_FILE= ${WRKSRC}/LICENSE > LIB_DEPENDS= libboost_thread.so:devel/boost-libs > > USES= autoreconf:build compiler:c++11-lang eigen:3 libtool:build \ >- localbase:ldflags pathfix pkgconfig >+ localbase:ldflags pathfix pkgconfig > USE_CXXSTD= c++14 > USE_GITHUB= yes > GH_ACCOUNT= ahupowerdns > USE_LDCONFIG= yes >+USE_RC_SUBR= metronome > > GNU_CONFIGURE= yes > > INSTALL_TARGET= install-strip > > SUB_FILES= pkg-message >+SUB_LIST+= METRONOME_DBDIR=${METRONOME_DBDIR} \ >+ METRONOME_USER=${METRONOME_USER} > >+METRONOME_USER?= _metronome >+USERS= ${METRONOME_USER} >+GROUPS= ${METRONOME_USER} >+ >+PLIST_SUB+= METRONOME_DBDIR=${METRONOME_DBDIR} \ >+ METRONOME_USER=${METRONOME_USER} > OPTIONS_DEFINE= DOCS > >+METRONOME_DBDIR?= /var/db/metronome >+ > pre-configure: > (cd ${WRKSRC}; ./bootstrap ) > >+post-install: >+ ${MKDIR} ${STAGEDIR}${METRONOME_DBDIR} >+ > .include <bsd.port.mk> >diff --git a/net-mgmt/metronome/files/metronome.in b/net-mgmt/metronome/files/metronome.in >new file mode 100644 >index 0000000000..d402442033 >--- /dev/null >+++ b/net-mgmt/metronome/files/metronome.in >@@ -0,0 +1,35 @@ >+#!/bin/sh >+ >+# PROVIDE: metronome >+# REQUIRE: DAEMON SERVERS >+# KEYWORD: shutdown >+ >+# >+# Add the following line to /etc/rc.conf to enable metronome: >+# >+# metronome_enable="YES" >+# >+# The next lines are optional since they have defaults >+# >+# metronome_carbonaddress="<set as needed>" >+# metronome_wsaddress="<set as needed>" >+# metronome_statsdir="<set as needed>" >+# >+ >+. /etc/rc.subr >+ >+name=metronome >+rcvar=${name}_enable >+ >+load_rc_config ${name} >+: ${metronome_enable:=NO} >+: ${metronome_carbonaddress:=127.0.0.1:2003} >+: ${metronome_wsaddress:=127.0.0.1:8000} >+: ${metronome_statsdir:=%%METRONOME_DBDIR%%} >+ >+pidfile=/var/run/${name}.pid >+actual_command="%%PREFIX%%/bin/${name} --daemon 0 --carbon-address ${metronome_carbonaddress} --webserver-address ${metronome_wsaddress} --stats-directory ${metronome_statsdir}" >+command=/usr/sbin/daemon >+command_args="-c -f -r -u %%METRONOME_USER%% -P ${pidfile} -- ${actual_command}" >+ >+run_rc_command "$1" >diff --git a/net-mgmt/metronome/pkg-plist b/net-mgmt/metronome/pkg-plist >index 23b0c9115e..b854edfbdb 100644 >--- a/net-mgmt/metronome/pkg-plist >+++ b/net-mgmt/metronome/pkg-plist >@@ -18,3 +18,4 @@ bin/msubmit > %%DATADIR%%/html/legend.css > %%DATADIR%%/html/lines.css > %%DATADIR%%/html/local.js >+@dir(%%METRONOME_USER%%, %%METRONOME_USER%%, ) %%METRONOME_DBDIR%% >-- >2.45.1 >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
tremere
:
maintainer-approval?
Actions:
View
|
Diff
Attachments on
bug 239819
:
206487
|
208649
| 250715