SF.net SVN: gar:[25843] csw/mgar/pkg/riemann/trunk

janholzh at users.sourceforge.net janholzh at users.sourceforge.net
Thu Jul 14 16:16:44 CEST 2016


Revision: 25843
          http://sourceforge.net/p/gar/code/25843
Author:   janholzh
Date:     2016-07-14 14:16:44 +0000 (Thu, 14 Jul 2016)
Log Message:
-----------
riemann/trunk: fix start script/smf

Modified Paths:
--------------
    csw/mgar/pkg/riemann/trunk/Makefile
    csw/mgar/pkg/riemann/trunk/files/cswriemann.xml

Added Paths:
-----------
    csw/mgar/pkg/riemann/trunk/files/riemann
    csw/mgar/pkg/riemann/trunk/files/riemann.config

Removed Paths:
-------------
    csw/mgar/pkg/riemann/trunk/files/0001-fix_opencsw_paths.patch

Modified: csw/mgar/pkg/riemann/trunk/Makefile
===================================================================
--- csw/mgar/pkg/riemann/trunk/Makefile	2016-07-14 13:09:32 UTC (rev 25842)
+++ csw/mgar/pkg/riemann/trunk/Makefile	2016-07-14 14:16:44 UTC (rev 25843)
@@ -14,7 +14,8 @@
 DISTFILES  = $(DISTNAME).tar.bz2
 DISTFILES  += LICENSE
 DISTFILES  += cswriemann.xml
-PATCHFILES += 0001-fix_opencsw_paths.patch
+DISTFILES  += riemann
+DISTFILES  += riemann.config
 LICENSE = LICENSE
 
 PRESERVECONF += /etc/opt/csw/riemann.config
@@ -42,8 +43,8 @@
 	ginstall -d -m 0755 $(DESTDIR)/etc/opt/csw
 	ginstall -d -m 0755 $(DESTDIR)$(prefix)/bin
 	ginstall -d -m 0755 $(DESTDIR)$(prefix)/lib/riemann
-	cp $(WORKSRC)/bin/riemann $(DESTDIR)$(prefix)/bin/riemann
+	cp $(WORKDIR)/riemann $(DESTDIR)$(prefix)/bin/
 	cp $(WORKSRC)/lib/riemann.jar $(DESTDIR)$(prefix)/lib/riemann
-	cp $(WORKSRC)/etc/riemann.config $(DESTDIR)/etc/opt/csw
+	cp $(WORKDIR)/riemann.config $(DESTDIR)/etc/opt/csw
 	ginstall -D -m 0644 $(WORKDIR)/cswriemann.xml $(DESTDIR)/var/opt/csw/svc/manifest/cswriemann.xml
 	@$(MAKECOOKIE)

Deleted: csw/mgar/pkg/riemann/trunk/files/0001-fix_opencsw_paths.patch
===================================================================
--- csw/mgar/pkg/riemann/trunk/files/0001-fix_opencsw_paths.patch	2016-07-14 13:09:32 UTC (rev 25842)
+++ csw/mgar/pkg/riemann/trunk/files/0001-fix_opencsw_paths.patch	2016-07-14 14:16:44 UTC (rev 25843)
@@ -1,47 +0,0 @@
-From 1bb7ad062bb8326ac1440492af53eec8a2fbb6f0 Mon Sep 17 00:00:00 2001
-From: Jan Holzhueter <jh at opencsw.org>
-Date: Thu, 14 Jul 2016 14:29:06 +0200
-Subject: [PATCH] fix_opencsw_paths
-
----
- bin/riemann        | 7 +++----
- etc/riemann.config | 2 +-
- 2 files changed, 4 insertions(+), 5 deletions(-)
-
-diff --git a/bin/riemann b/bin/riemann
-index 41a2514..3587a92 100755
---- a/bin/riemann
-+++ b/bin/riemann
-@@ -1,8 +1,7 @@
- #!/usr/bin/env bash
--top="$(dirname "$0")/.."
- 
--JAR="$top/lib/riemann.jar:$EXTRA_CLASSPATH"
--CONFIG="$top/etc/riemann.config"
-+JAR="/opt/csw/lib/riemann/riemann.jar:$EXTRA_CLASSPATH"
-+CONFIG="/etc/opt/csw/riemann.config"
- COMMAND="start"
- AGGRESSIVE_OPTS="-server -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseCompressedOops -XX:+CMSClassUnloadingEnabled"
- 
-@@ -52,4 +51,4 @@ for arg in "$@"; do
-   esac
- done
- 
--exec java $EXTRA_JAVA_OPTS $OPTS -cp "$JAR" riemann.bin "$COMMAND" "$CONFIG"
-+exec /opt/csw/java/jre/jre8/bin/java $EXTRA_JAVA_OPTS $OPTS -cp "$JAR" riemann.bin "$COMMAND" "$CONFIG"
-diff --git a/etc/riemann.config b/etc/riemann.config
-index 45eb340..8ba1e1d 100644
---- a/etc/riemann.config
-+++ b/etc/riemann.config
-@@ -1,7 +1,7 @@
- ; -*- mode: clojure; -*-
- ; vim: filetype=clojure
- 
--(logging/init {:file "riemann.log"})
-+(logging/init {:file "/var/log/riemann.log"})
- 
- ; Listen on the local interface over TCP (5555), UDP (5555), and websockets
- ; (5556)
--- 
-2.4.0
-

Modified: csw/mgar/pkg/riemann/trunk/files/cswriemann.xml
===================================================================
(Binary files differ)

Added: csw/mgar/pkg/riemann/trunk/files/riemann
===================================================================
--- csw/mgar/pkg/riemann/trunk/files/riemann	                        (rev 0)
+++ csw/mgar/pkg/riemann/trunk/files/riemann	2016-07-14 14:16:44 UTC (rev 25843)
@@ -0,0 +1,64 @@
+#!/usr/bin/env bash
+
+# Add some functions to work with and without smf
+. /lib/svc/share/smf_include.sh
+
+JAR="/opt/csw/lib/riemann/riemann.jar:$EXTRA_CLASSPATH"
+CONFIG="/etc/opt/csw/riemann.config"
+COMMAND="start"
+AGGRESSIVE_OPTS="-server -XX:+UseConcMarkSweepGC -XX:+UseParNewGC -XX:+CMSParallelRemarkEnabled -XX:+AggressiveOpts -XX:+UseFastAccessorMethods -XX:+UseCompressedOops -XX:+CMSClassUnloadingEnabled"
+
+usage()
+{
+  cat << EOF
+usage: $0 [-a] [java options ...] [command] [config-file]
+
+Runs Riemann with the given configuration file.
+
+OPTIONS:
+  -h    Show this message
+  -a    Adds some default aggressive, nonportable JVM optimization flags.
+  -v    Show version and exit
+
+COMMANDS:
+  start    Start the Riemann server (this is the default)
+  test     Run the configuration tests
+
+  Any unrecognized options (e.g. -XX:+UseParNewGC) will be passed on to java.
+EOF
+}
+
+OPTS=
+for arg in "$@"; do
+  case $arg in
+    "-a")
+      OPTS="$AGGRESSIVE_OPTS $OPTS"
+      ;;
+    "-h")
+      usage
+      exit 0
+      ;;
+    "-v")
+      COMMAND="version"
+      CONFIG="show"
+      ;;
+    -*)
+      OPTS="$OPTS $arg"
+      ;;
+    test|start)
+      COMMAND="$arg"
+      ;;
+    *)
+      CONFIG="$arg"
+     ;;
+  esac
+done
+
+
+if [[ -z "$SMF_FMRI" ]]; then
+	exec /opt/csw/java/jre/jre8/bin/java $EXTRA_JAVA_OPTS $OPTS -cp "$JAR" riemann.bin "$COMMAND" "$CONFIG"
+else
+	exec /opt/csw/java/jre/jre8/bin/java $EXTRA_JAVA_OPTS $OPTS -cp "$JAR" riemann.bin "$COMMAND" "$CONFIG" &
+
+fi
+


Property changes on: csw/mgar/pkg/riemann/trunk/files/riemann
___________________________________________________________________
Added: svn:executable
## -0,0 +1 ##
+*
\ No newline at end of property
Added: csw/mgar/pkg/riemann/trunk/files/riemann.config
===================================================================
--- csw/mgar/pkg/riemann/trunk/files/riemann.config	                        (rev 0)
+++ csw/mgar/pkg/riemann/trunk/files/riemann.config	2016-07-14 14:16:44 UTC (rev 25843)
@@ -0,0 +1,25 @@
+; -*- mode: clojure; -*-
+; vim: filetype=clojure
+
+(logging/init {:file "/var/log/riemann.log"})
+
+; Listen on the local interface over TCP (5555), UDP (5555), and websockets
+; (5556)
+(let [host "127.0.0.1"]
+  (tcp-server {:host host})
+  (udp-server {:host host})
+  (ws-server  {:host host}))
+
+; Expire old events from the index every 5 seconds.
+(periodically-expire 5)
+
+(let [index (index)]
+  ; Inbound events will be passed to these streams:
+  (streams
+    (default :ttl 60
+      ; Index all events immediately.
+      index
+
+      ; Log expired events.
+      (expired
+        (fn [event] (info "expired" event))))))

This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list