From 53b8e92dfb4ba6739b6a92f03220f405a8e19563 Mon Sep 17 00:00:00 2001 From: Mark Felder Date: Wed, 27 May 2015 15:54:36 +0000 Subject: [PATCH] Fix PATH issues for poller scripts used as cron entries We don't have /usr/local/{bin,sbin} in cron PATH by default Submitted by: mat --- net-mgmt/observium/Makefile | 3 +++ .../observium/files/patch-poller-wrapper.py | 17 +++++++++++++++++ net-mgmt/observium/files/patch-poller.php | 8 ++++++++ 3 files changed, 28 insertions(+) create mode 100644 net-mgmt/observium/files/patch-poller-wrapper.py create mode 100644 net-mgmt/observium/files/patch-poller.php diff --git a/net-mgmt/observium/Makefile b/net-mgmt/observium/Makefile index e14b3572e619..2bc3f3edd761 100644 --- a/net-mgmt/observium/Makefile +++ b/net-mgmt/observium/Makefile @@ -80,6 +80,9 @@ USE_MYSQL= server USE_MYSQL= client .endif +post-patch: + ${REINPLACE_CMD} 's|%%LOCALBASE%%|${LOCALBASE}|g' ${WRKSRC}/poller-wrapper.py ${WRKSRC}/poller.php + do-install: @${MKDIR} ${STAGEDIR}/${WWWDIR} .for dir in ${ROOT_DIRS} diff --git a/net-mgmt/observium/files/patch-poller-wrapper.py b/net-mgmt/observium/files/patch-poller-wrapper.py new file mode 100644 index 000000000000..7b49f68255de --- /dev/null +++ b/net-mgmt/observium/files/patch-poller-wrapper.py @@ -0,0 +1,17 @@ +--- poller-wrapper.py.orig 2014-11-04 16:14:27 UTC ++++ poller-wrapper.py +@@ -1,4 +1,4 @@ +-#! /usr/bin/env python ++#! %%LOCALBASE%%/bin/python + """ + poller-wrapper A small tool which wraps around the Observium poller + and tries to guide the polling process with a more modern +@@ -38,6 +38,8 @@ except: + print "threading, Queue, sys, subprocess, time, os, json" + sys.exit(2) + ++os.environ['PATH'] += ':%%LOCALBASE%%/sbin:%%LOCALBASE%%/bin' ++ + try: + import MySQLdb + except: diff --git a/net-mgmt/observium/files/patch-poller.php b/net-mgmt/observium/files/patch-poller.php new file mode 100644 index 000000000000..2633bb84463d --- /dev/null +++ b/net-mgmt/observium/files/patch-poller.php @@ -0,0 +1,8 @@ +--- poller.php.orig 2015-05-27 15:48:33 UTC ++++ poller.php +@@ -1,4 +1,4 @@ +-#!/usr/bin/env php ++#!%%LOCALBASE%%/bin/php +