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?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

joolsSenior Systems AdministratorCommented:
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
joolsSenior Systems AdministratorCommented:
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
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
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

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
joolsSenior Systems AdministratorCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Linux

From novice to tech pro — start learning today.