Failed executing: /usr/local/bin/convert

Author Message

Kristian Hole

Monday 12 February 2007 9:54:59 am

Hi All,

A word of warning to all of you running recent version of Red Hat Enterprise Linux (RHEL) / Fedora. Newer RHEL has a kernel level protection mechanism called SELinux (Security Enhanced Linux). If this is installed, and you are running eZ Publish you will typically get similar errors in the debugoutput to this when trying to upload an image in the admin interface:

Failed executing: /usr/local/bin/convert '-geometry' '600x600>' 'var/plain/storage/images/media/images//9769-1-eng-GB/blah.gif' 'GIF:var/plain/storage/images/media/images/9769-1-eng-GB/blah.gif', Error: , Return: 1

This is because the default SELinux disallows PHP to run the command.

You can disable the protection by running:

setenforce permissive

But a better solution would be to configure SELinux to work with this. Does anybody know the best way to set up SELinux to get this working?

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Paul Borgermans

Monday 12 February 2007 11:20:29 am

Hi Kristian,

SELinux can be a tough beast. We should create a policy file which can be used by eZ publish based installations (fine grained control).

Alternatively (from the httpd_selinux(8) man page):

You can disable SELinux protection for the httpd daemon by executing:

    setsebool -P httpd_disable_trans 1 service httpd restart 

Paul

eZ Publish, eZ Find, Solr expert consulting and training
http://twitter.com/paulborgermans

James Ward

Monday 12 February 2007 11:41:37 am

Paul,
That is exactly how I am currently getting around SELinux issues with eZ Publish. I couldn't agree more that we need an example policy to provide Apache with access to imagemagick and only the write permissions required to run eZ.

working at www.wardnet.com
blogging at www.jamesward.ca

Kristian Hole

Monday 12 February 2007 1:03:41 pm

Here is some more information:
http://codex.gallery2.org/Gallery2:Installation_on_a_SELinux_Server

Kristian

http://ez.no/ez_publish/documenta...tricks/show_which_templates_are_used
http://ez.no/doc/ez_publish/techn...te_operators/miscellaneous/attribute

Karl Latiss

Tuesday 13 February 2007 6:28:14 pm

On a default Centos 4 server install with eZ installed in /var/www/html I added the following to

/etc/selinux/targeted/src/policy/domains/misc/local.te

allow httpd_sys_script_t devpts_t:chr_file { read write };
allow httpd_sys_script_t httpd_runtime_t:file write;
allow httpd_sys_script_t httpd_sys_content_t:dir { add_name read setattr write };
allow httpd_sys_script_t httpd_sys_content_t:file { create setattr write };
allow httpd_sys_script_t self:capability { dac_override dac_read_search };
allow httpd_sys_script_t httpd_tmp_t:file { getattr read };
allow httpd_sys_script_t httpd_tmp_t:file write;
allow httpd_sys_script_t tmp_t:lnk_file read;

which seems to be enough to make things work.

Atvert Systems
http://www.atvert.com.au

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.

eZ debug

Timing: Jan 18 2025 11:40:42
Script start
Timing: Jan 18 2025 11:40:42
Module start 'layout'
Timing: Jan 18 2025 11:40:42
Module start 'content'
Timing: Jan 18 2025 11:40:43
Module end 'content'
Timing: Jan 18 2025 11:40:43
Script end

Main resources:

Total runtime1.4112 sec
Peak memory usage4,096.0000 KB
Database Queries67

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 588.0391152.6406
Module start 'layout' 0.00550.0032 740.679739.4922
Module start 'content' 0.00871.4010 780.1719648.7578
Module end 'content' 1.40970.0014 1,428.929716.1250
Script end 1.4111  1,445.0547 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00320.2247160.0002
Check MTime0.00130.0908160.0001
Mysql Total
Database connection0.00110.076910.0011
Mysqli_queries1.348895.5784670.0201
Looping result0.00070.0473650.0000
Template Total1.376997.620.6884
Template load0.00210.149520.0011
Template processing1.374897.419120.6874
Template load and register function0.00010.006710.0001
states
state_id_array0.00110.076010.0011
state_identifier_array0.00130.093720.0007
Override
Cache load0.00200.1398380.0001
Sytem overhead
Fetch class attribute can translate value0.00060.044140.0002
Fetch class attribute name0.00170.118480.0002
XML
Image XML parsing0.00150.105440.0004
class_abstraction
Instantiating content class attribute0.00000.001090.0000
General
dbfile0.00110.0755290.0000
String conversion0.00000.000640.0000
Note: percentages do not add up to 100% because some accumulators overlap

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
4content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
5content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
9content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
3content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
3content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 26
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs