After installing www/grafana4 I have noticed that grafana-cli installs plugins on the wrong directory. It should be /var/db/grafana4/plugins. Instead, it creates /var/db/grafana/plugins. Might be that grafana-4.1.2/src/github.com/grafana/grafana/pkg/cmd/grafana-cli/utils/grafana_path.go should be patched? A function calles returnOsDefault returns /var/db/grafana/plugins as the default directory for FreeBSD ---- func returnOsDefault(currentOs string) string { switch currentOs { case "windows": return "../data/plugins" case "darwin": return "/usr/local/var/lib/grafana/plugins" case "freebsd": return "/var/db/grafana/plugins" default: //"linux" return "/var/lib/grafana/plugins" } } ----- The problem seems to be in the patch-7410 file, which adds support for FreeBSD but sets /var/db/grafana instead of /var/db/grafana4 as default directory for FreeBSD.
Created attachment 181097 [details] Fix. Corrects the plugins path Replaces the plugins path on grafana-cli/utils/grafana_path.go.
You're right, the paths don't match, but I think it will make more sense to fix the path in the port than to patch grafana. The older grafana ports can't be installed at the same time and since they aren't supported upstream any more should probably go and www/grafana4 should be renamed www/grafana and all the paths and names changed to just "grafana" instead of "grafana4"
A commit references this bug: Author: swills Date: Wed May 31 16:53:04 UTC 2017 New revision: 442223 URL: https://svnweb.freebsd.org/changeset/ports/442223 Log: www/grafana4: update and fix bugs * Update to 4.3.2 [1] * Fix paths not to include the major version to fix plugin install and keep things uniform [2] * Correct boot.js seems to be used now [3] PR: 219639 [1] PR: 218010 [2] PR: 219131 [3] Submitted by: farrokhi [1] Reported by: Borja Marcos <borjam@sarenet.es> [2] Reported by: Ari Suutari <ari@stonepile.fi> [3] Changes: head/www/grafana4/Makefile head/www/grafana4/distinfo head/www/grafana4/files/grafana.conf.in head/www/grafana4/files/grafana.in head/www/grafana4/files/grafana4.conf.in head/www/grafana4/files/grafana4.in head/www/grafana4/pkg-plist
Committed, thanks!