Skip to content
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 install fails on RHEL 5 #621

Closed
fommil opened this issue Jul 7, 2015 · 10 comments
Closed

RPM install fails on RHEL 5 #621

fommil opened this issue Jul 7, 2015 · 10 comments
Labels

Comments

@fommil
Copy link

fommil commented Jul 7, 2015

I tried installing an RPM from this plugin and got this error

Creating system user: mdes in mdes with mdes user-daemon and shell /bin/false
useradd: unknown group mdes
Error in PREIN scriptlet in rpm package mdes-1.0.0_SNAPSHOT-1.noarch
error: %pre(mdes-1.0.0_SNAPSHOT-1.noarch) scriptlet failed, exit status 6
error:   install: %pre scriptlet failed (2), skipping mdes-1.0.0_SNAPSHOT-1
Installed products updated.

It looks like the mdes group is not being created before attempting to create the user mdes.

Actually I'm happy with root... but please tell me you don't try to delete the user/group on uninstall!

@muuki88 muuki88 added the rpm label Jul 7, 2015
@muuki88
Copy link
Contributor

muuki88 commented Jul 7, 2015

preinst-template has the correct order

@fommil
Copy link
Author

fommil commented Jul 7, 2015

Creating system group: mdes
groupadd: unrecognised option `--system'
Usage: groupadd [options] group

Options:
  -f, --force           force exit with success status if the specified
                group already exists
  -r,                       create system account
  -g, --gid GID         use GID for the new group
  -h, --help            display this help message and exit
  -K, --key KEY=VALUE       overrides /etc/login.defs defaults
  -o, --non-unique      allow create group with duplicate
                (non-unique) GID

Creating system user: mdes in mdes with mdes user-daemon and shell /bin/false
useradd: unknown group mdes
Error in PREIN scriptlet in rpm package mdes-1.0.0_SNAPSHOT-1.noarch
error: %pre(mdes-1.0.0_SNAPSHOT-1.noarch) scriptlet failed, exit status 6
error:   install: %pre scriptlet failed (2), skipping mdes-1.0.0_SNAPSHOT-1
Warning: scriptlet or other non-fatal errors occurred during transaction.

@fommil
Copy link
Author

fommil commented Jul 7, 2015

this is on RHEL 5 so maybe the groupadd interface has changed?

@muuki88
Copy link
Contributor

muuki88 commented Jul 7, 2015

Wow, indeed. That is actually pretty nasty.

@fommil
Copy link
Author

fommil commented Jul 7, 2015

I'm guessing the --system flag did a bunch of useful stuff that you're relying on.

@muuki88
Copy link
Contributor

muuki88 commented Jul 7, 2015

AFAIK this only affects the UID range being used. Systemusers are defined in a different range. Besides that, nothing I know about.

@fommil
Copy link
Author

fommil commented Jul 7, 2015

ok, I'll try out tomorrow with --system removed and let you know. If you're looking at this in a docker of RHEL5 (or old fedora/arch) or something, that would be awesome please let me know.

@fommil
Copy link
Author

fommil commented Jul 7, 2015

I have tried working around this by creating overrides in src/debian/DEBIAN/control-functions and src/rpm/scriptlets/preinst-template but they are not being picked up. Am I using the correct directory and filename?

@fommil
Copy link
Author

fommil commented Jul 8, 2015

control-functions is a replacement, not a template, so after trying to work out the correct file to put into src/rpm the only workaround I could come up with was

    linuxScriptReplacements := {
      val orig = linuxScriptReplacements.value.toMap
      orig ++ Seq(
      // WORKAROUND https://github.com/sbt/sbt-native-packager/issues/621
      ("control-functions", orig("control-functions").replace(" --system", ""))
    )}.toSeq,

if I need to customise that control-functions value any further I'm going to have to have my own template and load it from disk at this point.

@fommil
Copy link
Author

fommil commented Jul 8, 2015

--no-create-home

also not supported on RHEL 5

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants