Bug 119822

Summary: syntax error in /etc/init.d/cupsrenice
Product: [openSUSE] SUSE LINUX 10.0 Reporter: michel munnix <michel.munnix>
Component: BasesystemAssignee: Klaus Singvogel <kssingvo>
Status: RESOLVED FIXED QA Contact: E-mail List <qa-bugs>
Severity: Minor    
Priority: P5 - None CC: coolo, felix
Version: RC 1   
Target Milestone: ---   
Hardware: i686   
OS: All   
Whiteboard:
Found By: Other Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: output of ps -Af at time of the error

Description michel munnix 2005-10-02 17:44:46 UTC
This message is displayed on console after startup:
/etc/init.d/cupsrenice: line 58: [: too many arguments

line 58 checks if cupsd is running, but on my system, during startup, 2 cupsd
processes are running. This triggers the error.
I suggest to enclose x$ppid in double quotes
Comment 1 michel munnix 2005-10-02 17:46:00 UTC
Created attachment 51303 [details]
output of ps -Af at time of the error
Comment 2 Felix Möller 2005-10-03 21:03:14 UTC
The ps -A output at that time was probably like the following:
 6261 ?        00:00:00 cupsd
 6262 ?        00:00:00 cupsd

Therefore $ppid contained:
6261
6262

So the problem could be solved by changing:
    58          if [ x$ppid = x ]; then
    59                  return
    60          fi

to:
    58          if [ -z "$ppid" ]; then
    59                  return
    60          fi
Comment 3 Klaus Singvogel 2005-10-18 10:17:11 UTC
Thanks.
Sorry for delay, was in vacation.
Will work on it as scheduling and time permits.

This is not nice, but only lower priority: the script is only called once, when machine boots. --> adjusting.

Comment 4 Klaus Singvogel 2005-11-23 11:18:40 UTC
fixed in next version
Comment 5 Klaus Singvogel 2005-11-23 11:19:05 UTC
fixed in next version