Problems with %post script execution

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

 



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
reboot

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

#Install Red Hat Linux instead of upgrade
install

#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
skipx

%packages
@Network Support
@Web Server
@Utilities
@Software Development
@Kernel Development
@Server
@Software Development
pine

%post
cat >/etc/rc.d/init.d/ks-post-reboot <<End_Of_Post_Reboot
!/bin/bash
#  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 http://192.168.3.214/redhat73/install.txt
chmod +x /root/install.pl
/usr/bin/perl /root/install.pl
#Cleanup to remove the script on the initial startup.  Loops are bad...
mmm'kay?
rm -f /etc/rc.d/init.d/ks-post-reboot

halt
exit 0

#End of the reboot script
End_Of_Post_Reboot

#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


================
End KS.CFG
================






[Index of Archives]     [Red Hat General]     [CentOS Users]     [Fedora Users]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]

  Powered by Linux