Bug 479839 - kickstart option "services --disabled" comma delimited format does not allow whitespaces
kickstart option "services --disabled" comma delimited format does not allow ...
Status: CLOSED NEXTRELEASE
Product: Red Hat Enterprise Linux 5
Classification: Red Hat
Component: Documentation (Show other bugs)
5.4
All Linux
low Severity low
: rc
: ---
Assigned To: Ruediger Landmann
Content Services Development
: Documentation, Reopened
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-01-13 10:06 EST by James G. Brown III
Modified: 2014-12-01 18:06 EST (History)
6 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-04-27 20:03:03 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)

  None (edit)
Description James G. Brown III 2009-01-13 10:06:21 EST
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 16:08:02 EST
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 16:42:34 EST
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 11:21:36 EST
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 12:48:21 EST
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 16:05:40 EST
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 16:28:47 EST
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 16:34:52 EST
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 16:39:41 EST
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-03 22:22:08 EST
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 16:59:04 EDT
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-27 20:03:03 EDT
"Important" admonition added for F11 and RHEL5.4 guides.

Note You need to log in before you can comment on or make changes to this bug.