Call scripts in Rpm's: %pre %post sectino


 
Thread Tools Search this Thread
Operating Systems Linux Call scripts in Rpm's: %pre %post sectino
# 1  
Old 03-27-2009
Call scripts in Rpm's: %pre %post sectino

Hi,

In the rpm SPEC file there is %pre section for preinstall scripts.
We can write any think in the "sh" format here.

I want to call a script here. How can i do this?

Thanks
# 2  
Old 03-28-2009
Just call it like you would in any shell script. If it's a python script, then "python script.py". If it's a BASH script, then "bash script.sh", and so forth. Anything in the %pre section of the SPEC is standard Bourne shell scripting, so treat it like you would any other shell script.
# 3  
Old 03-30-2009
Okay,

But where will the script be present.
I can't put it in package, as i have to call it before the package is installed.

Which location i am left with now?
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Call functions from other scripts

i have a file that contains functions and i want the functions to be available in another script. of course, the ideal situation here would be to put the functions in the same script, but i dont own these scripts. so I have to call the functions file from a different script. how do i... (3 Replies)
Discussion started by: SkySmart
3 Replies

2. Shell Programming and Scripting

How to pre-check scrutinize all my shell scripts?

I have a few shell scripts. I need to run them on Flavors of Unix and Linux OS. The problem occurs that a set of commands in the script fail on one Operating System or the other. Below are a list of few commands that did not work on all operating systems i tested specifically becoz they... (15 Replies)
Discussion started by: mohtashims
15 Replies

3. Red Hat

Server health Checks pre & post Rebooting

Hi, Earlier we used to reboot servers based on adhoc request, never checked anything on it pre-reboot., But now i need to reboot regularly but most of the info is not available, I need to know want to make sure that server to be rebooted without any issues, so I want to do few prechecks which will... (5 Replies)
Discussion started by: nanz143
5 Replies

4. Shell Programming and Scripting

How to call different scripts?

I have 3 different scripts with 3 different functions, I would like to merge these 3 and make a master script. The following are my ideas: - ask user to pick which script he needs - after choosing, point it to the right script or... depending on the inputs provided by the user, all three... (1 Reply)
Discussion started by: priyanka.premra
1 Replies

5. 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

6. Shell Programming and Scripting

How to make RPM not write to RPM database if RPM fails to deploy?

How to make RPM not write to RPM database if RPM fails to deploy? IE I create an rpm spec file that contains the following if then exit 1 fi My rpm will fail at deployment, but if I do rpm -qa , I can see the rpm in the rpm db (3 Replies)
Discussion started by: 3junior
3 Replies

7. Red Hat

how can i know what arguments are passed to a pre install rpm script?

hi, i have an rpm, and i am looking at the presinstall script. i can see it takes in an argument, but what i do not know is how this argument is passed to the script? is there something that calls the preinstall script? i thought the preinstall script was the first thing executed. thanks (2 Replies)
Discussion started by: JamesByars
2 Replies

8. Shell Programming and Scripting

Call Multiple Scripts With Similar Name

I have a lot of scripts in one directory I was just wondering if there was a single command that could call each script. Example: There are scripts, "stopThisService.sh", "stopThatService.sh", "stopAnotherService.sh", and "stopYetAnotherService.sh". I'd like to be able to call them all by... (1 Reply)
Discussion started by: mrwatkin
1 Replies
Login or Register to Ask a Question