Created attachment 185951 [details] influx syslog patch Hi, the logfile redirection for influxdb doesn't seem to work, at least for me. Starting influxdb in jail bounces the complete output to the console. daemon(8) now has the options to redirect the childs stderr and stdout to a file or to syslog. I first thought about redirecting to a file but daemon(8) does not seem to implement a rotation scheme for it's output files. There is nothing that handles SIGHUP, SIGUSR1, ... So sending to syslog seems the most flexible way. The following patch implements just that and adds an influxd_facility variable to change the default syslog facility (daemon).
Hi, Is there some minimal FreeBSD version needed for this to work?
Just checked on https://www.freebsd.org/cgi/man.cgi and it seems these daemon options are rather new and only available since 11.1-RELEASE. I didn't realize that when i submitted the PR. I could redo the patch as a port option with an additional OS version check, if that helps.
(In reply to Sascha Holzleiter from comment #2) Yes, please update your patch to work with all supported branches.
Created attachment 186255 [details] Influx logger patch This new patch uses plain old piping into logger to accomplish what the last patch did with the new daemon(8) options. This should work for all branches. With this approach all users get logging to syslog out of the box. Although this is a change in the default install and not everyone is fond of syslog it beats having the logs flooded to console.
(In reply to Sascha Holzleiter from comment #4) Why have you removed influxd_precmd() function needed to create INFLUXD_PIDDIR? FreeBSD supports systems starting with RAM-based non-persistent /var (diskless(8)) and such systems need this. Also, this way you force usage of complex construct with extra run-time overhead for newer FreeBSD versions despite of the fact its daemon(8) has built-in syslog support. You can use following expression to differentiate FreeBSD version that have this support and use your previous approach for such systems: .if ${OPSYS} == FreeBSD && ((OSVERSION >= 1100513 && OSVERSION < 1200000) || OSVERSION >= 1200015) .endif And use post-build target to conditionnaly modify ${WRKDIR}/influxd startup script.
Created attachment 186331 [details] Influx log patch The removal of the precmd function was an error that slipped through. This patch can utilize both methods. For the OS versions with the new daemon(8) parameters it uses just daemon and for all others the logger pipe is used. I verified the OSVERSION = 11.1 part as i only have 11.1 systems available.
Dear maintainer, are you OK with latest patch version?
A commit references this bug: Author: eugen Date: Thu Sep 14 11:17:53 UTC 2017 New revision: 449830 URL: https://svnweb.freebsd.org/changeset/ports/449830 Log: Redirect all output to syslog by means of daemon(8) having syslog support in recent FreeBSD versions and by means of piping it to logger(1) for previous FreeBSD versions: add influxd_facility and influxd_priority variables (defaults to daemon.info). Bump PORTREVISION. PR: 221960 Submitted by: Sascha Holzleiter Approved by: cheffo (maintainer) Changes: head/databases/influxdb/Makefile head/databases/influxdb/files/influxd.in
Committed, thanks!