1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-16 07:58:04 +00:00

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
This commit is contained in:
Mark Felder 2015-05-27 15:54:36 +00:00
parent 2e9eed5bb1
commit 53b8e92dfb
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=387623
3 changed files with 28 additions and 0 deletions

View File

@ -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}

View File

@ -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:

View File

@ -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
<?php
/**