Help with kdump scripts


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Help with kdump scripts
# 1  
Old 10-20-2014
Help with kdump scripts

Hi I am trying hard to append a configuration file like
# grub.conf generated by anaconda
#
# Note that you do not have to rerun grub after making changes to this file
# NOTICE: You have a /boot partition. This means that
# all kernel and initrd paths are relative to /boot/, eg.
# root (hd0,0)
# kernel /vmlinuz-version ro root=/dev/VolGroup00/LogVol00
# initrd /initrd-version.img
#boot=/dev/sda
default=0
timeout=5
splashimage=(hd0,0)/grub/splash.xpm.gz
hiddenmenu
title Red Hat Enterprise Linux Server (2.6.18-238.el5)
root (hd0,0)
kernel /vmlinuz-2.6.18-238.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet
initrd /initrd-2.6.18-238.el5.img
i am trying to append a word called crashkernel in the line "kernel /vmlinuz-2.6.18-238.el5 ro root=/dev/VolGroup00/LogVol00 rhgb quiet" as that line is taken from command line parameter.

for eg: if i give -k=crashkernel=512M it should get appended in the above kernel line at the end of the line with double quotes. Please help.

Last edited by tejessk; 10-20-2014 at 06:26 AM.. Reason: i forgot to add that line
# 2  
Old 10-20-2014
Please use code tags as required by forum rules!

What is the problem? Where are you stuck?
# 3  
Old 10-20-2014
Hi,
I want to add a word called <carshkernel> at the end of the line.


Thanks,
Tejes
# 4  
Old 10-20-2014
This I understood. What is the problem? Where are you stuck?
# 5  
Old 10-20-2014
i am using tail command to add a crashkernel but my requirement is i want to search the file if crash kernel is there if not then append at the end of the line,i am not able to search for the pattern crash kernel and append it.
# 6  
Old 10-20-2014
awk can do that for you:
Code:
awk '/^kernel/ && !/crash/ {$0=$0 " \"-k=crashkernel=512M\""} 1' grub.conf

But this doesn't seem the right way to me - read the man grub-mkconfig page for correct grub handling.
# 7  
Old 10-21-2014
Hi Rudic,
Thank you so much for helping me out,i am using RHEL 5.6 i wanted to use sed command for this could you please help me out.


Thanks,
Tejes
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Red Hat

Kdump disk size

We have a Oracle linux 6.4 servers and memory is around 256GB, we are planing to configure kdump and I am confused about disk size I should set. I need your suggestion what would be the best size I should define for kdump. (3 Replies)
Discussion started by: karthik9358
3 Replies

2. Shell Programming and Scripting

Calling multiple scripts from another scripts

Dear all, I am working on script which call other shell scripts in a loop but problem is from second script am not able to come out. Here is the snippet:- #!/bin/bash HSFILE=/root/Test/Components.txt LOGFile=/opt/domain/AdminDomain/application/logs... (3 Replies)
Discussion started by: sharsour
3 Replies

3. Shell Programming and Scripting

Calling scripts from with scripts

Hi all, I'm wondering if you could give me some advice. I am new to scripting and am getting rather frustrated that i can get my script to call another script if certain criteria is met, via command line, but I cannot get the same script to work thru the cron jobs. My first script monitors... (8 Replies)
Discussion started by: echoes
8 Replies

4. Shell Programming and Scripting

KSH - How to call different scripts from master scripts based on a column in an Oracle table

Dear Members, I have a table REQUESTS in Oracle which has an attribute REQUEST_ACTION. The entries in REQUEST_ACTION are like, ME, MD, ND, NE etc. I would like to create a script which will will call other scripts based on the request action. Can we directly read from the REQUEST_ACTION... (2 Replies)
Discussion started by: Yoodit
2 Replies

5. Shell Programming and Scripting

Changing the Bash Scripts to Bourne Scripts:URGENT

Hi, I have to write a program to compute the checksums of files ./script.sh I wrote the program using bash and it took me forever since I am a beginner but it works very well. I'm getting so close to the deadline and I realised today that actually I have to use normal Bourne shell... (3 Replies)
Discussion started by: pgarg1989
3 Replies

6. Shell Programming and Scripting

Running scripts within scripts from cron

Hi all, I have set up a cron job which calls another shell script shell script which in turn calls a Java process. The cron tab looks so. 0,30 7-18 * * 1-5 /u01/home/weblogic/brp/bin/checkstatus.sh >> /u01/home/weblogic/logs/checkstatus.log The checkstatus.sh scripts looks like this. ... (4 Replies)
Discussion started by: sirbrian
4 Replies

7. Shell Programming and Scripting

Help with Script using rsh and scripts within scripts

Hi, I've written a script that runs on a Database server. It has to shutdown the Application server, do an Oracle Dump and then restart the Application server. Its been a long time since I wrote any shells scripts. Can you tell me if the scripts that I execute within my script will be executed... (3 Replies)
Discussion started by: brockwile1
3 Replies

8. UNIX for Dummies Questions & Answers

Profile scripts versus rc scripts....

what is the difference between login and profile scripts versus the rc scripts? (1 Reply)
Discussion started by: rookie22
1 Replies

9. Shell Programming and Scripting

Calling expect scripts from other expect scripts

Hi, First, let me explain the issue I am trying to solve. We have a lot of expect scripts with the duplicated send/expect commands. So, I'd like to be able to extract the duplicated code into the common scripts that can be used by other scripts. Below is my test where I am trying to call... (0 Replies)
Discussion started by: seva
0 Replies
Login or Register to Ask a Question