RE: Problems with %post script execution

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

 



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!



Chris


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

Chris-

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

Also, you may want to consider adding your init script in a different
way.
It is much cleaner to use chkconfig --add scriptname (this will also add
it
to the ntsysv utility). You just need to specify your
Start/Stop/Runlevel
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
### BEGIN INIT INFO
# Provides: $scriptname
### END INIT INFO
#
####BEGIN SCRIPT#####

Hope this helps.

--Nick

-----Original Message-----
From: Chris Meisinger [mailto:chris.meisinger@xxxxxxxxxxxxxxx] 
Sent: Wednesday, July 31, 2002 10:44 AM
To: kickstart-list@xxxxxxxxxx
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
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
================




_______________________________________________
Kickstart-list mailing list
Kickstart-list@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/kickstart-list


------------------------------------------------------------------------
------
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@xxxxxxxxxx
https://listman.redhat.com/mailman/listinfo/kickstart-list





[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