Bug 113254

Summary: error during exim startup: /etc/init.d/exim: line 37: [: too many arguments
Product: [Fedora] Fedora Reporter: Ian Kluft <ik-rhbz>
Component: eximAssignee: Thomas Woerner <twoerner>
Status: CLOSED RAWHIDE QA Contact:
Severity: medium Docs Contact:
Priority: medium    
Version: rawhide   
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-01-13 12:52:16 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ian Kluft 2004-01-11 02:15:09 UTC
Description of problem:
During startup of exim, the following error message is displayed:
   /etc/init.d/exim: line 37: [: too many arguments

Version-Release number of selected component (if applicable):
   exim-4.30-3

How reproducible:
   this happens every time exim starts

Steps to Reproduce:
1. boot system or run "/sbin/service exim start"
  
Actual results:


Expected results:


Additional info:
A one-liner diff fixes the problem for me.

*** /etc/init.d/exim.orig	2004-01-10 17:49:00.000000000 -0800
--- /etc/init.d/exim	2004-01-10 18:08:33.000000000 -0800
***************
*** 34,40 ****
  	# owned by exim - if owned by someone else we fix it up
  	if [ -f /var/log/exim/main.log ]
  	then
! 	    if [ "exim" != `ls -l /var/log/exim/main.log |cut -b 17-20` ]
  	    then
  		chown -R exim.exim /var/log/exim /var/spool/exim
  	    fi
--- 34,40 ----
  	# owned by exim - if owned by someone else we fix it up
  	if [ -f /var/log/exim/main.log ]
  	then
! 	    if [ "exim" != "$(ls -l /var/log/exim/main.log |cut -b 15-18)" ]
  	    then
  		chown -R exim.exim /var/log/exim /var/spool/exim
  	    fi

Note: I made two changes on the line:
1. I fixed the character range "cut -b 17-20" to "cut -b 15-18" so
that it correctly captures the group name "exim"
2. I changed the back-ticks (`) to a double-quoted (") bash command
substitution ( $() ) so that it won't display this error if a space
occurs within the string results from 'cut'.  A back-tick would still
have worked but I used the equivalent $( ) for readability.

Comment 1 Thomas Woerner 2004-01-13 12:52:16 UTC
Fixed in rawhide in version exim-4.30-4 or newer.