Opened 5 years ago

Closed 5 years ago

#831 closed Bug (fixed)

Patching archive.sh for other names of php-binaries than "php5"

Reported by: Uli Owned by:
Priority: major Milestone: Piwik 0.4.2
Component: Core Keywords: Archiving
Cc: Sensitive:

Description

On my Gentoo-System i've ran into a problem with [source:tags/0.4.1/misc/cron/archive.sh archive.sh] as there is no binary named "php5" available.

Attached you can find a patch for this issue. The new patch searches for a binary named "php". If there is no "php5" and no "php" available, then it fails with a message.

Attachments (3)

831-archive.sh-against-0.4.1-1.patch (642 bytes) - added by Uli 5 years ago.
Patch against 0.4.1
831-archive.sh-against-0.4.1-2.patch (746 bytes) - added by Uli 5 years ago.
Added suppressing of error-messages
piwik-831.patch (597 bytes) - added by pebosi 5 years ago.

Download all attachments as: .zip

Change History (7)

comment:1 Changed 5 years ago by vipsoft (robocoder)

  • Milestone set to 1 - Piwik 0.4.2

I may not have had my morning coffee yet, but I don't see a patch...

Changed 5 years ago by Uli

Patch against 0.4.1

comment:2 Changed 5 years ago by Uli

Sorry, somehow forgot to press submit :P

Changed 5 years ago by Uli

Added suppressing of error-messages

comment:3 Changed 5 years ago by Uli

I've seen an error when "which" cannot find the binary:

~# which php5
which: no php5 in (/sbin:/bin:/usr/sbin:/usr/bin)

This is now suppressed with version 2 of the patch. Sorry for the update, didn't recognize this in the first version.

The difference between Version 1 & 2:

--- piwik/misc/cron/archive.sh  2009-06-28 10:02:09.000000000 +0200
+++ misc/cron/archive.sh        2009-06-28 09:50:59.000000000 +0200
@@ -19,10 +19,10 @@
 # time_before_archive_considered_outdated = 3600
 # enable_browser_archiving_triggering = false

-PHP_BIN=`which php5`
+PHP_BIN=`which php5 2>/dev/null`
 if test -z $PHP_BIN; then
   # Probably only know as 'php'
-  PHP_BIN=`which php`
+  PHP_BIN=`which php 2>/dev/null`
   if test -z $PHP_BIN; then
      # No php available?
      `logger -s -t "Piwik" "ERROR: No binary for php available! Aborting archiving`

comment:4 Changed 5 years ago by vipsoft (robocoder)

  • Resolution set to fixed
  • Status changed from new to closed

(In [1267]) Fixes #831 - check for alternate php binary; also simplify retrieval of token_auth for sh lacking substring replacement

Changed 5 years ago by pebosi

Note: See TracTickets for help on using tickets.