build an RPM that requires JAVA_HOME to be set before insall?
Thanks to the great help I've gotten here I've managed to create a working RPM that does a bit of system configuration despite having little working knowledge of linux before starting. My RPM appeared to be working for awhile now but as a final test I installed it on a completely fresh install of RedHat enterprise edition 5.2 (after installing prereq rpms). It seems I'm running into a problem that the IMQ program(ie java message queues) will not boot correctly when I do this because it doesn’t know where to find the JRE.
I want to make sure that when my rpm is run the program actually works afterwards, and it won't work without IMQ. I was thinking I would have the RPM modify the IMQ configuration file to provide a -javahome argument when it boots up. I don't think I can set the configuration file to say '-javahome $JAVA_HOME' because the JAVA_HOME environmental variable won't be set until later in the boot up process after IMQ has attempted, and failed, to boot. so I had thought the rpm could set whatever the value of JAVA_HOME is at the time the rpm is installed as the home for IMQ. So my questions are... 1) how can I require that JAVA_HOME is set prior to running my RPM, and have the RPM not install if JAVA_HOME isn't set 2) is there a good way to have rpm be able to undo the change I made to the configuration file if it is erased? Should I save a version of the old configuration file before I make the changes somewhere to be used? 3) is this the best way to do things, or is there a simpler method? |
Put the test in the '%pre' section and exit on failure ( you may need to create a %pre section)
Code:
%pre |
Quote:
|
All times are GMT -5. The time now is 10:20 AM. |