-
Notifications
You must be signed in to change notification settings - Fork 443
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
FIX #214 Making rpm scriptlets overrideable #219
Conversation
A debian test fails: |
@muuki88 we are hitting the issue with the missing useradd in the rpmPre - we just tried building this branch and it still doesnt work to produce the desired outcome; rpms still dont have the preinstall macro specified. Any ideas? |
Hi @timperrett , thanks for reporting. I will make further investigations tomorrorw. This is pretty serious. |
@muuki88 - thanks; this is a pretty major issue for us so any advice would be welcome :-) |
This two fixes should solve the rpm-server issue. I also added as @aparkinson mentioned a way to add the service to autostart with |
debianControlFileDirectory SettingKey with the string id.
I justed tested this agaings CentOS 6. @aparkinson Can you try if the |
@muuki88 Is this actually fixed? After checking out the λ rpm -qp --scripts http/target/rpm/RPMS/noarch/http-3.2.6bcedba-0.noarch.rpm
postinstall scriptlet (using /bin/sh):
#
# Adding oncue to autostart
#
addservice() {
if hash update-rc.d 2>/dev/null; then
echo "Adding oncue to autostart using update-rc.d"
update-rc.d oncue defaults
elif chkconfig 2>/dev/null; then
echo "Adding oncue to autostart using chkconfig"
chkconfig --add oncue
chkconfig oncue on
else
echo "WARNING: Could not put oncue in autostart"
fi
}
addservice
service oncue start
preuninstall scriptlet (using /bin/sh):
# Halting oncue
echo "Shutdown oncue"
service oncue stop
postuninstall scriptlet (using /bin/sh):
# Removing system user/group : oncue and oncue
echo "Try deleting system user and group [oncue:oncue]"
if getent passwd | grep -q "^oncue:";
then
echo "Deleting system user: oncue"
userdel oncue
fi
if getent group | grep -q "^oncue:" ;
then
echo "Deleting system group: oncue"
groupdel oncue
fi In this case my user and group are never actually installed? The template in the src tree of the plugin indicates that it should create the username and group (as it also tries to delete them) |
Yeah, this should work.
You maybe confused by the output of |
Sure @muuki88 , heres the sbt output:
And the spec file:
|
Hm, this is confusing. The Can you post a minimal build.sbt and your build system config ( os, rpm version ) so I can reproduce the error. The Travis ci tests all work :-\ |
The only keys we're setting are these:
I was building it on my mac, but the same issue is present when building on CentOS |
PS: I'll work on making a minimal case that reproduces it. |
@muuki88 - download the reproducing case here: https://dl.dropboxusercontent.com/u/2946026/rpm-scriptlet-bug.zip |
Thanks a lot for your effort :) I hope to take a close look today as this makes me really curious. |
Okay, that was faster than I thought: As a workaround remove the option I will fix this with the next commit here. But not today :( |
Yeah I figured it would be due to that - I'll hack in the brp macro myself as a workaround but we eagerly await the fix for this |
Happy to announce the fix :) |
@muuki88 Looks fixed to me - can we merge it? Thanks for the fast turn around. |
Also works for me now. But should rpmPre setting mayby be a Seq[String] instead of an Option[String]? Currently it only works as long as the build script does not set there own rpmPre string. If the user has need for adding his own rpmPre scriptlet, he will loose the user creation scriptlet. I guess the same goes for the other scriptlets settings. |
I like the idea of a rpmPre <<= (rpmPre, linuxScriptReplacements) apply { (pre, replacements) =>
Some(pre.map(_ + "\n").getOrElse("") + "Your new content\n")
} |
FIX #214 Making rpm scriptlets overrideable
I'll merge this for now. @jsuereth can we release RC3? |
Correct, but that is a bit complex (and not very intuiative) compared to just rpmPre += "some usefull shell command" Should i create a seperate issue for it? |
@aparkinson can you take a look at this :)