Bug 479839

Summary: kickstart option "services --disabled" comma delimited format does not allow whitespaces
Product: Red Hat Enterprise Linux 5 Reporter: James G. Brown III <james.brown>
Component: DocumentationAssignee: Ruediger Landmann <rlandman+disabled>
Status: CLOSED NEXTRELEASE QA Contact: Content Services Development <ecs-dev-list>
Severity: low Docs Contact:
Priority: low    
Version: 5.4CC: borgan, ddumas, mhideo, pbatkowski, rlandman+disabled, syeghiay
Target Milestone: rcKeywords: Documentation, Reopened
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-04-28 00:03:03 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 James G. Brown III 2009-01-13 15:06:21 UTC
Description of problem:

Kickstarting using services --disabled with a list of services separated by commas in the ks.cfg a whitespace after a comma stops further disabling of services in the list.   

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

anaconda-11.1.2.113-1 (RHEL5.2)

How reproducible:

100%

Steps to Reproduce:
1. Include " services --disabled auditd, cups,smartd,nfslock " in ks.cfg
2. kickstart machine
3. service cups status
  
Actual results:

All services after first whitespace, in the example above "auditd, " are not disabled.

Expected results:

All services in comma delimited list regardless of whitespace are disabled.

Additional info:

It seems we could be smarter about handling whitespaces, but I would concede that simply modifying the documentation to include an example under Kickstart Options in the Installation Guide would be sufficient.

Comment 1 Chris Lumens 2009-01-13 21:08:02 UTC
This is consistent with command processing in the shell and basically anywhere else you'd expect to pass in a list of arguments.  If you put spaces in the list, it's going to break it up into multiple arguments.  If you need to put a space into the list, you need to surround your list with quote marks.  I don't see why we'd need to document this, as it's expected usual command line behavior.

Comment 2 James G. Brown III 2009-01-13 21:42:34 UTC
Chris, The reason I opened this was because I found the following in a client ks.cfg

# The below services commands don't work 
# so they are chkconfig --del in the post script.
# I'm leaving them here for doc purposes and maybe 
# someday RH will fix.
services --disabled audit
services --disabled autofs
services --disabled cpuspeed
services --disabled cups
services --disabled isdn, kudzu, netfs, nfslock, nfs, pcmcia, pcscd, portmap, rhnsd, rpcgssd, rpcidmapd
services --disabled rpcsvcgssd, sendmail, smartd, sysstat, xfs, xinetd, yum-updatesd

If one person is doing it others probably are also, although it is easy enough to work around in post which is why maybe there hasn't been as much fuss. 

Is adding an example to the documentation like below unreasonable?

services --disabled isdn,kudzu,netfs,nfslock,nfs 

Additionally, as in the above example of an end users assumptions in usage more than one services --disabled line in the ks.cfg negates the application to any instance of this option.

Installing with the following only disabled auditd and not the subsequent services.

services --disabled "auditd, autofs, cups, nfslock, portmap, smartd"

Comment 3 Chris Lumens 2009-01-15 16:21:36 UTC
Okay I can update the documentation to explain that all the usual shell rules do apply for pykickstart argument processing.

Your last comment does seem like a legitimate bug.  I'll have to give it a test and see what's going on.

Comment 4 James G. Brown III 2009-01-15 17:48:21 UTC
Additionally, in those instances where services --disabled fails there is no mention in anaconda.log about the failure. 

- James

Comment 5 Chris Lumens 2009-02-09 21:05:40 UTC
Okay after looking, here's what's going on now.  Since you've included it in quotes you do end up with a list containing all those various services.  However, instead of being ["autofs", "cups", "nfslock", ...] it's [" autofs", " cups", " nfslock", ...].  Naturally, those services do not exist and so they do not get disabled.

I suppose we can modify the code to deal with this.  However, I think it really would be best if the kickstart file could be changed to just remove the extraneous spaces.

Comment 6 James G. Brown III 2009-02-09 21:28:47 UTC
Chris, Changing the kickstart isn't a problem. If this isn't something you feel needs to be "fixed" that's fine. As I said in the original post, for me having a blurb in the documentation with a sample would suffice...

- James

Comment 7 Chris Lumens 2009-02-09 21:34:52 UTC
The documentation at http://fedoraproject.org/wiki/Anaconda/Kickstart now includes the following blurb:

pykickstart processes arguments to commands just like the shell does. If a list of arguments can be passed in, the arguments must be separated by commas and not include any extra spaces. If extra spaces are required in the list of arguments, the entire argument must be surrounded by double quotes. If quotes, spaces, or other special characters need to be added to the argument list, they must be escaped.

Does that suffice?

Comment 8 James G. Brown III 2009-02-09 21:39:41 UTC
Sure, I was just thinking about having an example;

services --disabled isdn,kudzu,netfs,nfslock,nfs 

Whatever you think is best though... Thanks!

- James

Comment 10 Michael Hideo 2009-03-04 03:22:08 UTC
Rudi,

Please be sure to get this into the RHEL5.4 Installation Guide and the Fedora 11 Installation Guide.

Setting devel ack to '+'

- Mike

Comment 12 Denise Dumas 2009-04-23 20:59:04 UTC
I'm taking this out of modified since there is no associated code change and it's confusing to the release team.  And I'm changing the component to documentation, since the action here is to correct the examples in the guide.

Comment 13 Ruediger Landmann 2009-04-28 00:03:03 UTC
"Important" admonition added for F11 and RHEL5.4 guides.