| Summary: | databases/influxdb: directory /var/run/influxdb not created at service start time (only at installation time) | ||
|---|---|---|---|
| Product: | Ports & Packages | Reporter: | Mark.Martinec |
| Component: | Individual Port(s) | Assignee: | Palle Girgensohn <girgen> |
| Status: | Closed FIXED | ||
| Severity: | Affects Some People | CC: | cheffo, girgen, matthew |
| Priority: | --- | Keywords: | needs-patch |
| Version: | Latest | Flags: | cheffo:
maintainer-feedback+
koobs: merge-quarterly? |
| Hardware: | Any | ||
| OS: | Any | ||
|
Description
Mark.Martinec
2016-10-28 15:39:14 UTC
Do you know any other port in FreeBSD ports three that do this? I do not know if there are any security issues by implementing this manually in the rc.d script, but for sure I do not want to be the first one implementing this in the ports tree. There certainly is prior art for creating certain directories under /var from an RC-script. See textproc/sphinxsearch for instance. The following search seems to reveal plenty of examples:
find /usr/ports -name '*.in' -exec egrep -H 'install.*-d.*/var/run' {} \;
Since the daemon has its own directory under /var/run/influxdb, there is no need to touch the pidfile. It is a trick to set ownership when it is diectly under /var/run.
Some thing like this is cool. Ok to commit?
Index: files/influxd.in
===================================================================
--- files/influxd.in (revision 427748)
+++ files/influxd.in (working copy)
@@ -41,7 +41,7 @@
influxd_precmd()
{
- install -o ${influxd_user} /dev/null ${influxd_pidfile}
+ install -d -o ${influxd_user} %%INFLUXD_PIDDIR%%
}
run_rc_command "$1"
I'm OK to commit.
Can you please also add:
do-build:
- @cd ${WRKSRC}/src/github.com/influxdata/${PORTNAME} && ${SETENV} GOPATH=${WRKSRC} go install ./...
+ @cd ${WRKSRC}/src/github.com/influxdata/${PORTNAME} && ${SETENV} GOPATH=${WRKSRC} go install -ldflags "-X main.version=${DISTVERSION}" ./...
This will make influxdb to report its "distversion" instead of unknown - this btw should work for telegraf and kapacitor also.
A commit references this bug: Author: girgen Date: Mon Dec 5 14:13:07 UTC 2016 New revision: 427896 URL: https://svnweb.freebsd.org/changeset/ports/427896 Log: Update to latest version. PR: 213857 Changes: head/databases/influxdb/Makefile head/databases/influxdb/distinfo head/databases/influxdb/files/influxd.in Committed. Thanks! |