[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

RE: Problems with %post script execution

Yep, that was it!

I was editing the ks.cfg under what I THOUGHT was VI in RedHat 7.3 but
the sneaky RH people symlinked Vim -> VI which hid all the ^M's.    Once
I noticed this, I used vim -b ks.cfg and saw all the ^M's.   Thanks for
the pointer!


-----Original Message-----
From: kickstart-list-admin redhat com
[mailto:kickstart-list-admin redhat com] On Behalf Of Buro, Nicholas F
Sent: Wednesday, July 31, 2002 10:30 AM
To: 'kickstart-list redhat com'
Subject: RE: Problems with %post script execution


You might want to make sure that your kickstart file is in "unix"
use "dos2unix" to convert it. I have run into some issues where
commands do not run properly due to the ^M's..

Also, you may want to consider adding your init script in a different
It is much cleaner to use chkconfig --add scriptname (this will also add
to the ntsysv utility). You just need to specify your
options at the top of the script. Then you can remove it with chkconfig
--del, just a thought, here is an example of the top of the script..

#! /bin/bash
# the 2,3,4,5 means it will start in runlevels 2,3,4,5 with priority 11
# and stop with priority 91 (stops in runlevels 1,6,0)
# then use 'chkconfig --add scriptname' to add it to ntsysv and the
# appropriate runlevels
# scriptname   script quick description
# chkconfig: 2345 11 91
# description: script description \
#		   the slash continues the line
# probe: true
# Provides: $scriptname

Hope this helps.


-----Original Message-----
From: Chris Meisinger [mailto:chris meisinger communitech net] 
Sent: Wednesday, July 31, 2002 10:44 AM
To: kickstart-list redhat com
Subject: Problems with %post script execution

Okay here's the problem that I'm running into.   My kickstart works
fine.  It installs everything properly, updated RPMs, etc.  in the %post
section, it creates a script in /etc/rc.d/init.d/, symlinks it over in
/etc/rc.d/rc3.d, and chmod +x's the script.   

It creates the script, but won't Chmod it or symlink it.  Anything after
the echo statement of the script itself does not work.  I've attached
the ks.cfg so you can check it out.

Begin ks.cfg

#Custom Kickstart for Redhat 7.3 Installs
#Written for Communitech.Net by Chris M. 
#Completion Date - 07-09-02 - 

#System language
lang en_US

#Language modules to install
langsupport --default en_US en_US 

#System keyboard
keyboard us

#System mouse
mouse none

#System timezone
timezone --utc America/Chicago

#Root password
rootpw --iscrypted $1$KaøAãÄnW$QbgZaJuJdTG864D6wheMx/

#Reboot after installation

#System bootloader configuration
bootloader --useLilo --linear --location=mbr 

#Install Red Hat Linux instead of upgrade

#Use FTP installation media
url --url ftp://skillz.communitech.net/

#Clear the Master Boot Record
zerombr yes

#Clear all partitions from the disk
clearpart --all --initlabel 

#Disk partitioning information
part /boot --fstype ext3 --size 100 
part  swap --size 1000 
part / --fstype ext3 --size 1 --grow 

#Use DHCP networking
network --bootproto dhcp

#System authorization information
auth  --useshadow  --enablemd5 

#Firewall configuration
firewall --disabled 

#Do not configure the X Window System

@Network Support
@Web Server
@Software Development
@Kernel Development
@Software Development

cat >/etc/rc.d/init.d/ks-post-reboot <<End_Of_Post_Reboot
#  This script is run after the first reboot, then removes itself.  
#  This should take a very large pain, out of my ass.  Kthxbye.
# 				-chrism 07-09-02
#Okay, putting perl into the ks.cfg is a pain.   It halfass
#Parses everything before hand.   Consequently, all ref's to 
#the shell "$_" are interpreted as /bin/sh as that's technically
#the shell that's it is run as, and all $_'s are changed to /bin/sh
#   this sucks.   
#I'm going to keep the %post section small, and have it grab a 
#modified install script and just run that.   simple, and I don't
# have to rewrite a bunch of stuff  
#				-chrism 7-23-02

exec >/tmp/ks-post-output.log 2>&1
#This creates a logging facility in /tmp/ks-post-output.log

tail -f /tmp/ks-post-reboot.log >/dev/tty7&;
#this dumps all logging in realtime to TTY7, hit CTRL+F7 to seea
wget -O /root/install.pl
chmod +x /root/install.pl
/usr/bin/perl /root/install.pl
#Cleanup to remove the script on the initial startup.  Loops are bad...
rm -f /etc/rc.d/init.d/ks-post-reboot

exit 0

#End of the reboot script

#hook the post install script into RC.D so it'll actually run.  

chmod +x /etc/rc.d/init.d/ks-post-reboot
ln -s /etc/rc.d/init.d/ks-post-reboot /etc/rc.d/rc3.d/S86ks-post-reboot


Kickstart-list mailing list
Kickstart-list redhat com

Notice: This e-mail message, together with any attachments, contains
information of Merck & Co., Inc. (Whitehouse Station, New Jersey, USA)
that may be confidential, proprietary copyrighted and/or legally
privileged, and is intended solely for the use of the individual or
entity named on this message. If you are not the intended recipient, and
have received this message in error, please immediately return this by
e-mail and then delete it.


Kickstart-list mailing list
Kickstart-list redhat com

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]