aboutsummaryrefslogtreecommitdiffstats
path: root/sysutils
diff options
context:
space:
mode:
Diffstat (limited to 'sysutils')
-rw-r--r--sysutils/rubygem-fluentd/Makefile18
-rw-r--r--sysutils/rubygem-fluentd/distinfo4
-rw-r--r--sysutils/rubygem-fluentd/files/fluentd.in47
3 files changed, 60 insertions, 9 deletions
diff --git a/sysutils/rubygem-fluentd/Makefile b/sysutils/rubygem-fluentd/Makefile
index 33264d3de4a1..60cbc754790b 100644
--- a/sysutils/rubygem-fluentd/Makefile
+++ b/sysutils/rubygem-fluentd/Makefile
@@ -1,12 +1,7 @@
-# New ports collection makefile for: rubygem-fluentd
-# Date created: 10 Jul 2012
-# Whom: Jun Kuriyama <kuriyama@FreeBSD.org>
-#
# $FreeBSD$
-#
PORTNAME= fluentd
-PORTVERSION= 0.10.25
+PORTVERSION= 0.10.27
CATEGORIES= sysutils rubygems
MASTER_SITES= RG
@@ -23,8 +18,14 @@ RUN_DEPENDS= \
USE_RUBY= yes
#RUBY_VER= 1.9 # Please set RUBY_DEFAULT_VER=1.9 in /etc/make.conf
USE_RUBYGEMS= yes
-PLIST_FILES= bin/fluent-cat bin/fluent-gem bin/fluentd
+PLIST_FILES= bin/fluent-cat bin/fluent-debug bin/fluent-gem bin/fluentd \
+ "@exec ${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 775 /var/run/fluentd" \
+ "@unexec ${RMDIR} /var/run/fluentd 2>/dev/null || true"
RUBYGEM_AUTOPLIST= yes
+USE_RC_SUBR= fluentd
+USERS= fluentd
+GROUPS= fluentd
+SUB_LIST+= USER=${USERS} GROUP=${GROUPS}
.include <bsd.port.pre.mk>
@@ -32,4 +33,7 @@ RUBYGEM_AUTOPLIST= yes
IGNORE= requires Ruby 1.9, please install this first
.endif
+post-install:
+ ${INSTALL} -d -o ${USERS} -g ${GROUPS} -m 775 /var/run/fluentd
+
.include <bsd.port.post.mk>
diff --git a/sysutils/rubygem-fluentd/distinfo b/sysutils/rubygem-fluentd/distinfo
index a61abf85a74b..e4466c0e1542 100644
--- a/sysutils/rubygem-fluentd/distinfo
+++ b/sysutils/rubygem-fluentd/distinfo
@@ -1,2 +1,2 @@
-SHA256 (rubygem/fluentd-0.10.25.gem) = 6b28e11749aee03b47d11b98c60192071a3eceaa5741eb89af7450e814340e7d
-SIZE (rubygem/fluentd-0.10.25.gem) = 56320
+SHA256 (rubygem/fluentd-0.10.27.gem) = 32069902fa26ae0b32473f1369ce30978e8434c4be854dcfbfc925497b123394
+SIZE (rubygem/fluentd-0.10.27.gem) = 57856
diff --git a/sysutils/rubygem-fluentd/files/fluentd.in b/sysutils/rubygem-fluentd/files/fluentd.in
new file mode 100644
index 000000000000..789cb6e475d5
--- /dev/null
+++ b/sysutils/rubygem-fluentd/files/fluentd.in
@@ -0,0 +1,47 @@
+#!/bin/sh
+
+# $FreeBSD$
+#
+# PROVIDE: fluentd
+# REQUIRE: LOGIN
+# KEYWORD: shutdown
+#
+# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
+# to enable this service:
+#
+# fluentd_enable (bool): Set to NO by default.
+# Set it to YES to enable fluentd.
+# fluentd_config (path): Set to %%PREFIX%%/etc/doormand/doormand.cf
+# by default.
+# fluentd_db_dir (path): Set DB dir (default: "/var/db/fluentd")
+
+. /etc/rc.subr
+
+name=fluentd
+rcvar=fluentd_enable
+extra_commands="init"
+
+load_rc_config $name
+
+: ${fluentd_enable:="NO"}
+: ${fluentd_config="%%PREFIX%%/etc/fluentd/fluent.conf"}
+: ${fluentd_dir="%%PREFIX%%/etc/fluentd"}
+: ${fluentd_user="%%USER%%"}
+: ${fluentd_group="%%GROUP%%"}
+
+init_cmd="init_fluentd_dir"
+
+command=%%PREFIX%%/bin/${name}
+pidfile=/var/run/${name}/${name}.pid
+
+command_args="-d $pidfile -c $fluentd_config"
+
+init_fluentd_dir()
+{
+ # XXX: Using sudo for now. fluentd user have /nonexistent as
+ # $HOME, and nologin as shell.
+ install -d -o ${fluentd_user} -g ${fluentd_group} -m 775 ${fluentd_dir}
+ %%PREFIX%%/bin/sudo -u fluentd ${command} --setup ${fluentd_dir}
+}
+
+run_rc_command "$1"