Bug 18110 - RFE: Don't strip comments from %post script - ignore instead
RFE: Don't strip comments from %post script - ignore instead
Status: CLOSED RAWHIDE
Product: Red Hat Linux
Classification: Retired
Component: anaconda (Show other bugs)
7.0
i386 Linux
low Severity medium
: ---
: ---
Assigned To: Michael Fulbright
: FutureFeature
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2000-10-02 12:42 EDT by Karl Hakimian
Modified: 2008-05-01 11:37 EDT (History)
0 users

See Also:
Fixed In Version:
Doc Type: Enhancement
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2001-01-09 18:40:34 EST
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 Karl Hakimian 2000-10-02 12:42:26 EDT
The documentation says that anaconda will ignore comments. Instead,
it actually strips them from the file including from the %post
section. This breaks post scripts such as

cat <<EOF >/etc/init.d/service
#!/bin/sh
#
# chkconfig: - 95 10
# description: local startup script
#
do something...
EOF

This can be worked around with something like

sed -n 's/^-- //p' <<EOF >/etc/init.d/service
-- #!/bin/sh
-- #
-- # chkconfig: - 95 10
-- # description: local startup script
-- #
-- do something...
EOF

But that is a bit of a pain, when just passing the comments would make
life a lot easier.
Comment 1 Erik Troan 2000-11-21 13:17:17 EST
Fixed in CVS. Left blank lines in as well.
Comment 2 Brock Organ 2000-12-12 17:11:52 EST
this failed in test w/the qa1212.1 tree:

lang en_US
network --bootproto dhcp
nfs --server porkchop --dir /mnt/redhat/test/qa1212.1/i386
keyboard "us"
zerombr yes
clearpart --all
part / --size 2000 --asprimary 
part swap --size 256 --asprimary 
install
mouse genericps/2
timezone America/New_York
xconfig 
rootpw xxxxxxxx
auth --useshadow --enablemd5
lilo --location mbr --append "mem=60m"
%packages
@Base
@X Window System

%post

cat <<EOF >/tmp/foo.test
#!/bin/sh
#
# chkconfig: - 95 10
# description: local startup script
#
echo "foo.test"
EOF

fails with a traceback:

Traceback (innermost last):
File "/usr/bin/anaconda", line 346, 
File "/usr/lib/anaconda/kickstart.py", line 605,
File "/usr/lib/anaconda/kickstart.py", line 566,
File "/usr/lib/anaconda/kickstart.py", line 391, in readKickstart
if args[0]=="%post" or args[0]=="%pre":

IndexError: list index out of range



Comment 3 Michael Fulbright 2001-01-09 18:40:31 EST
Should be fixed according to ewt.
Comment 4 Brock Organ 2001-01-10 16:26:24 EST
verified fix in qa0110.0 test tree ...
Comment 5 Mike A. Harris 2001-07-17 10:12:47 EDT
*** Bug 47343 has been marked as a duplicate of this bug. ***
Comment 6 Mike A. Harris 2001-07-17 10:15:48 EDT
No no no..  Not a dupe, 18810, not 18110..  duh..  sorry.

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