Bug 122488

Summary: CRLF formatting in /etc/sysconfig/spamassassin breaks init script
Product: [Fedora] Fedora Reporter: Brad Bailey <brad-fedora>
Component: spamassassinAssignee: Chip Turner <cturner>
Status: CLOSED RAWHIDE QA Contact:
Severity: low Docs Contact:
Priority: medium    
Version: 1   
Target Milestone: ---   
Target Release: ---   
Hardware: i386   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2004-05-25 20:38:12 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:
Bug Depends On:    
Bug Blocks: 123710    

Description Brad Bailey 2004-05-05 04:13:43 UTC
From Bugzilla Helper:
User-Agent: Opera/7.23 (X11; Linux i686; U)  [en]

Description of problem:
The configuration file /etc/sysconfig/spamassassin, as packaged with 
the spamassassin RPM, is formatted with CRLF line-ends. This breaks 
the initialization script when additional settings such as NICELEVEL 
are entered into this file to be sourced during service startup 
and/or shutdown.

This is trivial to fix, once noticed, but the resulting error 
reported by the init script is misleading, and the true problem of 
the DOS-formatted file is not at all obvious.

I have checked the spamassassin packages for Fedora Core 1, Fedora 
Core 2 test 3, Rawhide, and even Red Hat 9, and this file is in DOS 
format in each and all of them.

Version-Release number of selected component (if applicable):
2.63

How reproducible:
Always

Steps to Reproduce:
1. Check format of /etc/sysconfig/spamassassin:

 root@localhost# file /etc/sysconfig/spamassassin
 /etc/sysconfig/spamassassin: ASCII text, with CRLF line terminators

2. Edit /etc/sysconfig/spamassassin and add a NICELEVEL option:

 root@localhost# vi /etc/sysconfig/spamassassin
 # Options to spamd 
 SPAMDOPTIONS="-d -c -a -m5 -H"
 # Add this line: 
 NICELEVEL="19"

3. Check format of /etc/sysconfig/spamassassin again:

 root@localhost# file /etc/sysconfig/spamassassin
 /etc/sysconfig/spamassassin: ASCII text, with CRLF line terminators
 
4. Attempt to start the service:

 root@localhost# service spamassassin start

Actual Results:  The service fails to start because of an invalid 
parameter being passed to `nice`:

 'tarting spamd: nice: invalid priority `19
                                                           [FAILED]


Expected Results:  The service should have started, with a nice level 
as specified in the sysconfig file.

Additional info:

After adding a `set -x` in the init script:

root@localhost# service spamassassin start
 ...
 + '[' color = verbose -a -z '' ']'
 + '[' -z '' ']'
 ' nice -n $'19\r' initlog -q -c 'spamd -d -c -a -m5 -H
 'ice: invalid priority `19

Converting the file to standard UNIX ASCII text, as all other files 
in /etc/sysconfig are, solves the problem.

Comment 1 Warren Togami 2004-05-25 20:38:12 UTC
fixed in spamassassin-3.0-0.0.svn20040524