need help for kickstart post installation part not working cleanly

Hi,

I have created one kickstart file in which postinstallation part is not working properly.

Please help with the syntax of the same.
I am attaching the kickstart file with this case.

Also i am looking to give percentage to my volume groups rather then specific size for example 40 % to rootvg and 60 % to data vg?

any help on that?

many thanks
KICK.txt
The RockAsked:
Who is Participating?
 
joolsCommented:
this seems to have question creep, generally you would post a new question, however, while I'm here...

As a generic kickstart I use

clearpart --all

and dont specify disks unless I have to or the hardware needs it.

The network config differs, RHEL7 seems quite different from RHEL <=6, I would do a generic kickstart for each.

I have;

network --onboot yes --device eth0 --mtu=1500 --bootproto static --ip=@PRODIP1@ --netmask=255.255.255.0 --gateway=@PRODGW@ noipv6 --hostname @PRODHOST@

where the @ strings are substituted for values selected in a menu and have whatever network config I need, I've not got an example for RHEL7 for this yet.

As for hiding the script, you can add whatever you want in the kickstart file, a simple rm would suffice.

If you have a custom ISO its exactly the same thing. the kickstart file is just a script, you can get it to do anything you want, even download stuff

Going back to your initial question, for the filesystem percentage, do you have an idea what you want the output to look like? Does it have to be for each vg?
0
 
joolsCommented:
It might be worth while changing your script part to do something like this;

cat << _EOF_ > /usr/local/bin/dynmotd
#!/bin/bash
# This Script is created by OBS Linux Engineering Team
# Its created to display few basic info at SSH Login

PROCCOUNT=`ps -l | wc -l`
PROCCOUNT=`expr $PROCCOUNT - 4`
if [[ $(groups) == *irc* ]]
then
        ENDPROC=`cat /etc/security/limits.conf | grep "@irc" | grep nproc | awk {'print $4'}`
        ENDSESSION=`cat /etc/security/limits.conf | grep "@irc" | grep maxlogins | awk {'print $4'}`
        PRIVLAGED="IRC Account"
else
        ENDPROC=`cat /etc/security/limits.conf | grep "*" | grep nproc | awk {'print $4'}`
        ENDSESSION="Unlimited"
        PRIVLAGED="Regular User"
fi

echo "+++++++++++++++++: System Data :+++++++++++++++++++"
echo "+ Hostname = `hostname`"
echo "+ Address = `/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`"
echo "+ Kernel = `uname -r`"
echo "+ Server Installation Date = `rpm -qi basesystem | grep Install | cut -c 15-46`"
echo "+ Uptime = `uptime | sed 's/.*up ([^,]*), .*/1/'`"
echo "+ No of CPU = `grep processor /proc/cpuinfo | wc -l`"
echo "+ `lscpu | grep 'socket'`"
echo "+ Memory = `cat /proc/meminfo | grep MemTotal | awk {'print $2'}` kB"
echo "++++++++++++++++++: User Data :++++++++++++++++++++"
echo "+ Username = `whoami`"
echo "+ Privlages = $PRIVLAGED"
echo "+ Sessions = `who | grep $USER | wc -l` of $ENDSESSION MAX"
echo "+ Processes = $PROCCOUNT of $ENDPROC MAX"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
echo
_EOF_

Open in new window

0
 
joolsCommented:
Actually, this fixes a few typos :-)

cat << _EOF_ > /usr/local/bin/dynmotd
#!/bin/bash
# This Script is created by OBS Linux Engineering Team
# Its created to display few basic info at SSH Login

NUMPROC=\$(ps -el | wc -l)
PROCCOUNT=\$(expr \$NUMPROC - 4 )
if [[ \$(groups) == *irc* ]]
then
        ENDPROC=\`cat /etc/security/limits.conf | grep "@irc" | grep nproc | awk {'print \$4'}\`
        ENDSESSION=\`cat /etc/security/limits.conf | grep "@irc" | grep maxlogins | awk {'print \$4'}\`
        PRIVLAGED="IRC Account"
else
        ENDPROC=\`cat /etc/security/limits.conf | grep "*" | grep nproc | awk {'print \$4'}\`
        ENDSESSION="Unlimited"
        PRIVLAGED="Regular User"
fi

echo "+++++++++++++++++: System Data :+++++++++++++++++++"
echo "+ Hostname = `hostname`"
echo "+ Address = `/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`"
echo "+ Kernel = `uname -r`"
echo "+ Server Installation Date = `rpm -qi basesystem | grep Install | cut -c 15-46`"
echo "+ Uptime = `uptime | sed 's/.*up ([^,]*), .*/1/'`"
echo "+ No of CPU = `grep processor /proc/cpuinfo | wc -l`"
echo "+ `lscpu | grep 'socket'`"
echo "+ Memory = `cat /proc/meminfo | grep MemTotal | awk {'print $2'}` kB"
echo "++++++++++++++++++: User Data :++++++++++++++++++++"
echo "+ Username = `whoami`"
echo "+ Privlages = \$PRIVLAGED"
echo "+ Sessions = `who | grep \$USER | wc -l` of \$ENDSESSION MAX"
echo "+ Processes = \$PROCCOUNT of \$ENDPROC MAX"
echo "+++++++++++++++++++++++++++++++++++++++++++++++++++"
echo
_EOF_

Open in new window

0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

 
The RockAuthor Commented:
Thank you ! it works - but i have another issue while using this kickstart for UEFI and LEGACY mode any idea what could be the option i can choose so that it works for both mode?

ALso look at below parameters:
#version=DEVEL
text
install
cdrom
lang en_US.UTF-8
keyboard us
network --onboot yes --bootproto dhcp

rootpw  --iscrypted $1$BL/hB$1RmgK4DaOcCpvyc/sNSbv1                            

firewall --service=ssh

authconfig --enableshadow --passalgo=sha512
selinux --disabled
timezone --utc Asia/Kolkata

# Bootloader
bootloader --location=mbr --driveorder=sda
zerombr

# Partition table
clearpart --linux --drives=sda


Any suggestion so that above all options will be generic and work on all physical and virtual machines?

like all type of disks and all type of nics?

and what about bootonSAN opton?

Thank you again
0
 
The RockAuthor Commented:
Also how i can hide my original kickstart file and scripts after installation ? and also from the custom ISO if i made it from the same kickstart file ?
0
 
The RockAuthor Commented:
thank you so much jools for help - as suggested for other queries i have opened a new  question below: please help in that too:

http://www.experts-exchange.com/OS/Linux/Q_28654054.html
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.