Date: Sun, 17 Jan 2021 15:25:33 +0000 (UTC) From: Eugene Grosbein <eugen@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r561829 - in head/security/i2pd: . files Message-ID: <202101171525.10HFPXGd011092@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: eugen Date: Sun Jan 17 15:25:33 2021 New Revision: 561829 URL: https://svnweb.freebsd.org/changeset/ports/561829 Log: security/i2pd: make the port compatible with syslogging i2pd supports logging via syslog. This may be enabled with its configuration file, but port's startup script forces logging to a file using command line switches that override configuration file. This change adds syslogging support with following rc.conf setting: i2pd_logfile="syslog" # translates to: --log syslog or i2pd_logfile="syslog:warn" # translates to: --log syslog --loglevel warn The change is backward compatible with previous settings. PR: 252159 Approved by: amdmi3 (maintainer timeout over 3 weeks) Modified: head/security/i2pd/Makefile head/security/i2pd/files/i2pd.in Modified: head/security/i2pd/Makefile ============================================================================== --- head/security/i2pd/Makefile Sun Jan 17 15:15:34 2021 (r561828) +++ head/security/i2pd/Makefile Sun Jan 17 15:25:33 2021 (r561829) @@ -3,6 +3,7 @@ PORTNAME= i2pd PORTVERSION= 2.33.0 +PORTREVISION= 1 CATEGORIES= security net-p2p MAINTAINER= amdmi3@FreeBSD.org Modified: head/security/i2pd/files/i2pd.in ============================================================================== --- head/security/i2pd/files/i2pd.in Sun Jan 17 15:15:34 2021 (r561828) +++ head/security/i2pd/files/i2pd.in Sun Jan 17 15:25:33 2021 (r561829) @@ -9,6 +9,12 @@ # # i2pd_enable="YES" # +# By default, it writes logs to /var/log/i2pd/i2pd.log not using syslogd. +# You may change log file name with i2pd_logfile variable in /etc/rc.conf, or +# if you prefer it send logs to syslogd then add the following to /etc/rc.conf: +# +# i2pd_logfile="syslog:warn" # for flags: --log syslog --loglevel warn +# . /etc/rc.subr @@ -22,12 +28,18 @@ load_rc_config ${name} : ${i2pd_group="%%GROUP%%"} : ${i2pd_pidfile="/var/run/${name}/${name}.pid"} : ${i2pd_datadir="/var/db/${name}"} -: ${i2pd_logfile="/var/log/${name}/${name}.log"} +case "$i2pd_logfile" in + syslog) log="--log syslog" ;; + syslog:*) log="--log syslog --loglevel ${i2pd_logfile#syslog:}" ;; + *) : ${i2pd_logfile="/var/log/${name}/${name}.log"} + log="--log file --logfile ${i2pd_logfile}" ;; +esac + 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" +command_args="--pidfile ${i2pd_pidfile} --service --datadir ${i2pd_datadir} --daemon $log" extra_commands="reload" reload_cmd="pkill -1 -F ${i2pd_pidfile} -x i2pd"
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202101171525.10HFPXGd011092>