- Add rc.d script

This commit is contained in:
Dmitry Marakasov 2016-12-22 14:27:18 +00:00
parent f93e01db48
commit 6401637498
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=429158
6 changed files with 56 additions and 5 deletions

2
GIDs
View file

@ -196,7 +196,7 @@ fcron:*:247:
# free: 252
_adsuck:*:253:
# free: 254
# free: 255
_i2pd:*:255:
_tor:*:256:
_smtpd:*:257:
_smtpq:*:258:

2
UIDs
View file

@ -201,7 +201,7 @@ fcron:*:247:247::0:0:fcron pseudo-user:/nonexistent:/usr/sbin/nologin
# free: 252
_adsuck:*:253:253::0:0:Adsuck ad blocking user:/nonexistent:/usr/sbin/nologin
# free: 254
# free: 255
_i2pd:*:255:255::0:0:I2P daemon:/var/db/i2pd:/usr/sbin/nologin
_tor:*:256:256::0:0:Tor anonymizing router:/var/db/tor:/usr/sbin/nologin
_smtpd:*:257:257::0:0:OpenSMTPD:/var/empty:/usr/sbin/nologin
_smtpq:*:258:258::0:0:OpenSMTPD queue user:/var/empty:/usr/sbin/nologin

View file

@ -3,6 +3,7 @@
PORTNAME= i2pd
PORTVERSION= 2.11.0
PORTREVISION= 1
CATEGORIES= security net-p2p
MAINTAINER= amdmi3@FreeBSD.org
@ -21,11 +22,16 @@ GH_ACCOUNT= PurpleI2P
USES= cmake compiler:c++11-lib ssl
CMAKE_SOURCE_PATH=${WRKSRC}/build
USE_RC_SUBR= ${PORTNAME}
PLIST_FILES= bin/${PORTNAME} \
man/man1/${PORTNAME}.1.gz
PORTDOCS= *
USERS= _i2pd
GROUPS= _i2pd
PLIST_SUB= USER="${USERS}" GROUP="${GROUPS}"
SUB_LIST= USER="${USERS}" GROUP="${GROUPS}"
OPTIONS_DEFINE= AESNI UPNP DOCS
AESNI_DESC= Use AES-NI instructions set
@ -37,12 +43,15 @@ UPNP_LIB_DEPENDS= libminiupnpc.so:net/miniupnpc
.include <bsd.port.pre.mk>
.if ${SSL_DEFAULT:Mlibressl*}
BROKEN= does not build with LibreSSL (unsupported DSA_set0_pqg(), DSA_set0_key())
BROKEN= does not build with LibreSSL (boost libressl compatibility problems)
.endif
do-install:
${INSTALL_PROGRAM} ${WRKSRC}/${PORTNAME} ${STAGEDIR}${PREFIX}/bin
${INSTALL_MAN} ${WRKSRC}/debian/${PORTNAME}.1 ${STAGEDIR}${MAN1PREFIX}/man/man1
@${MKDIR} ${STAGEDIR}/var/run/i2pd
@${MKDIR} ${STAGEDIR}/var/log/i2pd
@${MKDIR} ${STAGEDIR}/var/db/i2pd
do-install-DOCS-on:
@${MKDIR} ${STAGEDIR}${DOCSDIR}

View file

@ -0,0 +1,32 @@
#!/bin/sh
#
# PROVIDE: i2pd
# REQUIRE: DAEMON NETWORKING FILESYSTEMS
# BEFORE: LOGIN
# KEYWORD: shutdown
#
# Add the following line to /etc/rc.conf to enable i2pd:
#
# i2pd_enable="YES"
#
. /etc/rc.subr
name="i2pd"
rcvar=i2pd_enable
load_rc_config ${name}
: ${i2pd_enable="NO"}
: ${i2pd_user="%%USER%%"}
: ${i2pd_group="%%GROUP%%"}
: ${i2pd_pidfile="/var/run/${name}/${name}.pid"}
: ${i2pd_datadir="/var/db/${name}"}
: ${i2pd_logfile="/var/log/${name}/${name}.log"}
required_dirs=${i2pd_datadir}
pidfile=${i2pd_pidfile}
command="%%PREFIX%%/bin/${name}"
command_args="--pidfile ${i2pd_pidfile} --service --datadir ${i2pd_datadir} --log file --logfile ${i2pd_logfile} --daemon"
run_rc_command "$1"

View file

@ -0,0 +1,5 @@
You may want to increase default i2pd bandwidth limit by adding
--bandwidth to i2pd_flags in /etc/rc.conf. Add the following to
allow the highest traffic:
i2pd_flags="--bandwidth X"

5
security/i2pd/pkg-plist Normal file
View file

@ -0,0 +1,5 @@
bin/i2pd
man/man1/i2pd.1.gz
@dir(%%USER%%,%%GROUP%%,755) /var/run/i2pd
@dir(%%USER%%,%%GROUP%%,755) /var/log/i2pd
@dir(%%USER%%,%%GROUP%%,755) /var/db/i2pd