-
Notifications
You must be signed in to change notification settings - Fork 445
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rpm and directories #92
Comments
Huh, I thought we had this dir stuff working correctly at one point. In any case, we can clean this up, as we have the info in packageMapping, IIRC. Also, for the default "magical" RPM generation, we'll be adding in the ability to customize the user/group for the application being bundled (while the symlinks in /usr/bin will be owned by root, as appropriate). |
I'm guessing by that you mean that if an explicit mapping was created for "/opt/vendor/project/bin/some.jar" then the directories "/opt/vendor", "/opt/vendor/project" and "/opt/vendor/project/bin" would be also automatically created? In general that's convenient, but in some cases an uninstall shouldn't impact, for example "/opt/vendor" because other packages may also be installed there. RPM does the right thing and leaves the directory if its non-empty, but anyone examining the RPM prior to un-installation may be concerned. |
What I've run into in the past (with RPMs and CentOS 4-5-ish) was that if you claimed a directory in one RPM, you could not install another RPM that also claimed that directory. Is that still an issue, and if so, when was it fixed? I'd like to stay compatible with a reasonable set of versions of RPM. |
I'm running CentOS 6.4-final on my VM. I have created three RPMs that claim ownership of %dir %attr(0755,coreservices,coreservices) /var/log/trafficland
%dir %attr(0755,coreservices,coreservices) /var/log/trafficland/%NAME%
... (where The I can install all three side by side and remove each one with no problems. If there happen to be log files in those directories, RPM does the right thing and leaves them intact. If there are no log files and the last package is removed, RPM does the right thing and also deletes the I do the same thing for the |
I will download and test on CentOS 4.0 tonight and see what happens, since I already have the projects setup in order to do so. (I know its really just about rpmbuild version numbers, but I have fears of trying to go backwards with rpmbuild and it seems like having an older CentOS image to test these builds on isn't a bad idea anyway.) I would hope behavior like this would be consistent across RPM versions. If not then at least RPM does make its directories like |
cool. Thanks man! |
Maybe this will solve your problem: #107 linuxPackageMappings += packageMapping(
(target.value / "file.jar") -> "/opt/trafficland/project/lib"
) withUser "tluser" withGroup "tlgroup" withPerms "0755" withContents() This will generate a packageMapping for each directory. |
-Tested this approach on Fedora 18 and worked fine. You can specify directory to directory mapping and add UpdateParent directories are not accordingly created, when you specify only a single file, only and only if you map the complete directory structure:
then you can do linuxPackageMappings += packageMapping(
(target.value / "opt") -> "/opt"
) withUser "tluser" withGroup "tlgroup" withPerms "0755" withContents() AdvantagesThis approach has the advantage, that it's very compatible with |
What is the status on this? Is the |
from my end, those solve this. I'll mark it as resolved, with the option of opening a new issue with a more refined proposal against |
Perfect. I think we could release an |
Do we need to do some more compatibility testing against different RPM distro's? The Test On page is a little light in this area. FYI I'm currently testing all the recent changes against RHEL 6.2+ |
Definitely! More tests never hurt :) |
So, 0.7.0-RC1 or 0.7.0-M4? I can do either. Excited to see @aparkinson's results. |
You don't have to wait on me as its slow process building RHEL for testing |
Can sombebody test on Fedora? |
I am currently using 0.7.0-rc1 and building a play application java_server, the directory that is created /usr/share/ isn't owned by the user or group created. I have tried adding in the code above in the build.scala as you've mentioned and can't seem to get it to work, this is on centos 6.5 .settings(linuxPackageMappings += packageMapping( But to no avail, any help would be appreciated. |
For RPMs its important to specify all of the directories that come along with the package; i.e.,
/opt/trafficland/project
, so proper user:group ownership is created and also for when the RPM is removed the directories which were created during installation are removed as well.Specifying
/opt/trafficland/project/lib/file.jar
is not enough,/opt/trafficland/project
,/opt/trafficland/project/lib
should also be specified.I can get around this limitation now by using the following hack:
(Likewise for each subdirectory, such as
lib
,bin
,conf
, etc. the RPM deploys files into.)Having a cleaner
packageDirectory
for initially empty directories and specifically to satisfy clean RPMs would be better solution than the hack above.The text was updated successfully, but these errors were encountered: