mirror of
https://git.freebsd.org/ports.git
synced 2025-07-18 17:59:20 -04:00
net/endlessh: Add log rotation
PR: 256286
This commit is contained in:
parent
164f9966b4
commit
3aa7a82534
4 changed files with 34 additions and 6 deletions
|
@ -15,7 +15,10 @@ GH_ACCOUNT= skeeto
|
|||
|
||||
PLIST_FILES= bin/endlessh \
|
||||
man/man1/endlessh.1.gz \
|
||||
"@sample ${PREFIX}/etc/endlessh.conf.sample"
|
||||
"@sample ${PREFIX}/etc/endlessh.conf.sample" \
|
||||
${PREFIX}/etc/endlessh.newsyslog.conf
|
||||
|
||||
SUB_FILES= pkg-message
|
||||
|
||||
post-patch:
|
||||
${REINPLACE_CMD} 's|share/man|man|;s|/usr/local|${PREFIX}|' ${WRKSRC}/Makefile
|
||||
|
@ -23,6 +26,8 @@ post-patch:
|
|||
${WRKSRC}/endlessh.c ${WRKSRC}/endlessh.1
|
||||
|
||||
post-install:
|
||||
${INSTALL_DATA} ${FILESDIR}/endlessh.conf.sample ${STAGEDIR}${PREFIX}/etc/
|
||||
${INSTALL_DATA} ${FILESDIR}/endlessh.newsyslog.conf \
|
||||
${FILESDIR}/endlessh.conf.sample ${STAGEDIR}${PREFIX}/etc/
|
||||
${STRIP} ${STAGEDIR}${PREFIX}/bin/endlessh
|
||||
|
||||
.include <bsd.port.mk>
|
||||
|
|
|
@ -26,8 +26,9 @@ load_rc_config $name
|
|||
: ${endlessh_logfile:=/var/log/endlessh.log}
|
||||
|
||||
pidfile=/var/run/endlessh.pid
|
||||
daemonpidfile=/var/run/daemon_endlessh.pid
|
||||
procname="%%PREFIX%%/bin/endlessh"
|
||||
command=/usr/sbin/daemon
|
||||
command_args='-p ${pidfile} -u ${endlessh_daemonuser} -o ${endlessh_logfile} ${procname} -f ${endlessh_config} ${endlessh_args}'
|
||||
command_args='-p ${pidfile} -P ${daemonpidfile} -u ${endlessh_daemonuser} -Ho ${endlessh_logfile} ${procname} -f ${endlessh_config} ${endlessh_args}'
|
||||
|
||||
run_rc_command $1
|
||||
|
|
11
net/endlessh/files/endlessh.newsyslog.conf
Normal file
11
net/endlessh/files/endlessh.newsyslog.conf
Normal file
|
@ -0,0 +1,11 @@
|
|||
# newsyslog configuration file for endlessh(1)
|
||||
#
|
||||
# Link (or copy) endlessh.newsyslog.conf to /usr/local/etc/newsyslog.conf.d/
|
||||
# to take care of log rotation.
|
||||
#
|
||||
# ln -s /usr/local/etc/endlessh.newsyslog.conf /usr/local/etc/newsyslog.conf.d
|
||||
#
|
||||
# See newsyslog.conf(5) for details.
|
||||
#
|
||||
# logfilename [owner:group] mode count size when flags [/pid_file] [sig_num]
|
||||
/var/log/endlessh.log root:wheel 600 7 * @T00 G /var/run/daemon_endlessh.pid SIGHUP
|
|
@ -11,11 +11,22 @@ To see the connections set LogLevel 1 in endlessh.conf or add "-v" to
|
|||
endlessh_args. Sending SIGUSR1 to endlessh (pkill USR1 endlessh) will add
|
||||
statistics to the /var/log/endlessh.log file
|
||||
|
||||
Neither endlessh nor daemon support rotating the logfile, use periodic or
|
||||
cron to copy the logfile and truncate it using
|
||||
Link (or copy) endlessh.newsyslog.conf to ${PREFIX}/newsyslog.conf.d/
|
||||
to take care of log rotation.
|
||||
|
||||
$ echo -n > /var/log/endlessh.log
|
||||
ln -s ${PREFIX}/etc/endlessh.newsyslog.conf $PREFIX}/etc/newsyslog.conf.d/
|
||||
|
||||
EOD
|
||||
}
|
||||
,
|
||||
{
|
||||
type: upgrade
|
||||
message: <<EOD
|
||||
|
||||
Link (or copy) endlessh.newsyslog.conf to %%PREFIX%%/newsyslog.conf.d/
|
||||
to take care of log rotation.
|
||||
|
||||
ln -s %%PREFIX%%/etc/endlessh.newsyslog.conf %%PREFIX%%/etc/newsyslog.conf.d/
|
||||
|
||||
EOD
|
||||
]
|
Loading…
Add table
Reference in a new issue