When installing Drush via PEAR, drush.php is not executable:

/usr/share/php/drush# ls -la drush.php 
-rw-r--r-- 1 root root 6175 Aug  7 04:27 drush.php

Since DRUSH_COMMAND (via drush_find_drush()) always returns the path to drush.php, any use of that constant will break.

Comments

moshe weitzman’s picture

Status: Active » Postponed (maintainer needs more info)

Is is supposed to be? The supported entry point for Drush is the drush bash script

ergonlogic’s picture

The supported entry point for Drush is the drush bash script

Well, there's this (admittedly old) issue: #586466: Drush.php is no longer directly executable (can interfere with backend invoke). But, that's what I had figured initially, except that DRUSH_COMMAND seems to always be set to drush.php:

// Statically define a way to call drush again.
  define('DRUSH_COMMAND', drush_find_drush());

Also, Here's how this breaks Aegir: #2050881: drush.php: Permission denied creating crontab. I'm suggesting that our crontab entry call something like: '/usr/bin/env php DRUSH_COMMAND'.

So, here are the options that I see:

  1. Make drush.php executable in PEAR installs.
  2. Make drush_find_drush() (or maybe a new function) able to point DRUSH_COMMAND to the shell script.
  3. Add '/usr/bin/env php' to DRUSH_COMMAND.
  4. Change the documentation to make it clear that DRUSH_COMMAND may not be directly executable.
moshe weitzman’s picture

Assigned: Unassigned » greg.1.anderson
Status: Postponed (maintainer needs more info) » Active
greg.1.anderson’s picture

Category: bug » support
Status: Active » Fixed

Drush prepends php before DRUSH_COMMAND wherever it uses it, which currently is only inside the function drush_build_drush_command(). It seems to me that Aegir should just call this function; don't pass any parameters for a local call, and pass NULL for $drush_path and $php if specifying $os and $remote_command = TRUE, and you'll get back the correct string to use in your exec call.

ergonlogic’s picture

Okay, thanks for clarifying.

Status: Fixed » Closed (fixed)

Automatically closed -- issue fixed for 2 weeks with no activity.