summaryrefslogtreecommitdiff
path: root/www
diff options
context:
space:
mode:
authorjperkin <jperkin@pkgsrc.org>2017-10-13 12:28:19 +0000
committerjperkin <jperkin@pkgsrc.org>2017-10-13 12:28:19 +0000
commit73dd3c6be692b6ddb9d4d0e7aa4fa7e49bb2fc11 (patch)
treedd8121fd8161e41621a8e22042190ff983cba8d6 /www
parentd40eef5e1382e27b227d70d88a861d639f76e120 (diff)
downloadpkgsrc-73dd3c6be692b6ddb9d4d0e7aa4fa7e49bb2fc11.tar.gz
grafana: Add SMF manifest, based on PR#52612
Diffstat (limited to 'www')
-rw-r--r--www/grafana/Makefile4
-rw-r--r--www/grafana/files/smf/manifest.xml29
2 files changed, 32 insertions, 1 deletions
diff --git a/www/grafana/Makefile b/www/grafana/Makefile
index 78b793a205f..afdab086e7a 100644
--- a/www/grafana/Makefile
+++ b/www/grafana/Makefile
@@ -1,4 +1,4 @@
-# $NetBSD: Makefile,v 1.3 2017/07/23 07:20:42 wiz Exp $
+# $NetBSD: Makefile,v 1.4 2017/10/13 12:28:19 jperkin Exp $
GITHUB_PROJECT= grafana
DISTNAME= grafana-4.4.1
@@ -53,6 +53,8 @@ SUBST_SED.fix-cfg+= -e 's,^;\(static_root_path = \).*,\1${PUBLICDIR},g'
BUILD_DEFS+= GRAFANA_USER GRAFANA_GROUP VARBASE
FILES_SUBST+= GRAFANA_USER=${GRAFANA_USER:Q}
FILES_SUBST+= GRAFANA_GROUP=${GRAFANA_GROUP:Q}
+FILES_SUBST+= DATADIR=${DATADIR:Q}
+
GRAFANA_USER?= grafana
GRAFANA_GROUP?= grafana
OWN_DIRS_PERMS+= ${DATADIR} ${GRAFANA_USER} ${GRAFANA_GROUP} 0700
diff --git a/www/grafana/files/smf/manifest.xml b/www/grafana/files/smf/manifest.xml
new file mode 100644
index 00000000000..bed6523df75
--- /dev/null
+++ b/www/grafana/files/smf/manifest.xml
@@ -0,0 +1,29 @@
+<?xml version="1.0"?>
+<!DOCTYPE service_bundle SYSTEM "/usr/share/lib/xml/dtd/service_bundle.dtd.1">
+<service_bundle type='manifest' name='grafana:default'>
+ <service name='@SMF_PREFIX@/@SMF_NAME@' type='service' version='1'>
+ <create_default_instance enabled='false' />
+ <single_instance />
+ <dependency name='network' grouping='require_all' restart_on='none' type='service'>
+ <service_fmri value='svc:/milestone/network:default' />
+ </dependency>
+ <dependency name='fs-local' grouping='require_all' restart_on='none' type='service'>
+ <service_fmri value='svc:/system/filesystem/local:default' />
+ </dependency>
+ <method_context working_directory="@PREFIX@/share/grafana">
+ <method_credential user='@GRAFANA_USER@' group='@GRAFANA_GROUP@' />
+ </method_context>
+ <exec_method type='method' name='start'
+ exec='@PREFIX@/bin/grafana-server -config @PKG_SYSCONFDIR@/grafana.conf -pidfile @DATADIR@/grafana.pid &amp;'
+ timeout_seconds="60" />
+ <exec_method type='method' name='stop' exec=':kill' timeout_seconds="60" />
+ <template>
+ <common_name>
+ <loctext xml:lang='C'>Grafana Visualization Server</loctext>
+ </common_name>
+ <documentation>
+ <doc_link name='homepage' uri='http://docs.grafana.org' />
+ </documentation>
+ </template>
+ </service>
+</service_bundle>