Linux - GeneralThis Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I am running a setup script as part of the installation of my RPM package (%post). The setup.sh script is a temporary script which I delete at the end of my %post section.
I would like to avoid including these installation files in the RPM database. I am new to building RPMs. I thought of using the %install and %clean sections, but was unsuccessful using su there. The spec snippet is below.
Preparing... ##################################################
file /appl/home/tuser/rpm/script/setup.sh from install of TIbEnvTibPrf-1.0-1 conflicts with file from package TIbAdmLdapCfg-1.0-1
I would like to avoid including these installation files in the RPM database.
Any compelling reasons why?
Quote:
Originally Posted by gmabrito
I thought of using the %install and %clean sections, but was unsuccessful using su there.
Why is running under another user necessary?
Quote:
Originally Posted by gmabrito
Preparing... ##################################################
file /appl/home/tuser/rpm/script/setup.sh from install of TIbEnvTibPrf-1.0-1 conflicts with file from package TIbAdmLdapCfg-1.0-1
Are you building RPMs as root account user? That isn't best practice.
Quote:
Originally Posted by gmabrito
su - tuser -c "${SCRIPT}/setup.sh" >> ${AUDITS}/%{name}.log
What does the script do? Can't it be detected and run on first run of the service or application?
The RPM is contains a java based installation which will be run as the application user. The installation files are large and are no longer needed after installation. I cannot just install the application on a build server and make the RPM from that. The installation must run on the server. There is an installation manager file that is basically like a registry for the software suite (ugly).
I need to run the installation as the application user, not as root. That is the reason for the switch user.
I build the application as the application user, not as root on a build server.
The setup.sh script runs the installation binary passing it the silent install file also included in the RPM.
If the setup.sh script fails then the RPM should fail, so that we know installation was not a success.
Last edited by gmabrito; 03-19-2008 at 09:05 PM.
Reason: clarification
OK. I think the fundamental question here is: if you basically use RPM for temporary payload delivery and kicking off the actual install, then should you be using RPM in the first place? What's the added value?
Back to the problem of
Quote:
file /appl/home/tuser/rpm/script/setup.sh from install of TIbEnvTibPrf-1.0-1 conflicts with file from package TIbAdmLdapCfg-1.0-1
, why not rename setup.sh to %{name}_setup.sh (or use random value)? That way TIbEnvTibPrf_setup.sh and TIbAdmLdapCfg_setup.sh won't conflict. If that's not what you're looking for please post the .spec files and verbose install runs between BB code tags (for readability) or if it's too long tarball them up, U/L to some free hoster and post the D/L URI here.
You are correct this is an unorthodox approach, and RPM is only a delivery method (couldn't find a good example of this, except when a RPM does a make on the server). RPMs are our standard for software deployment the tools for distribution and config management at our shop is very mature for RPM. The SAs prefer it to always be in an RPM and I am trying to take advantages of these features.
Sounds like the right approach to use %{name}_setup.sh and continue to use the %post section of the spec file.
Continuing with this approach does pose a problem. The temp files used during installation are removed after installation. RPM has stored these files in the RPM DB, and these files are no longer on the system. What problem will this cause with a RPM DB being inaccurate?
This is why I was looking for a way to ignore some files from the RPM DB perspective or to a command to delete these files from the RPM DB along with the files on the file system.
I was looking for something similar to the Solaris command removef. Does RPM have such options or language?
No installf or removef.
Quote:
Originally Posted by gmabrito
What problem will this cause with a RPM DB being inaccurate?
Willfully neglecting standards should give you the same motivation to perform better as cattle get from prodding rods ;-p
Quote:
Originally Posted by gmabrito
The temp files used during installation are removed after installation. RPM has stored these files in the RPM DB, and these files are no longer on the system.
How about packaging up your installation code as tarball and list that as the only %file and using a %post script to unpack it to a tempdir, install and remove the tempdir? This still violates the standard but it should get you going.
I built a RPM with no %setup, no %install and no visible %files.
I used the %ghost tag to keep certain files out of the RPMDB.
The payload being in %post, it does what I want it to.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.