Adding user with rpm in %packages section

Matt Rose mrose at n-able.com
Thu Apr 9 13:03:05 UTC 2009


You need to make sure adduser and addgroup are in the Requires: line of 
the spec file.  Possibly you need a PreReq: line in the .spec file, but 
according to Jeff Johnson, that's not clear.  Try putting adduser/group 
in the Requires line first.

Matt

Tom Brown wrote:
> Hi
>
> I have an rpm that creates a user as part of the %pre in the rpm like so
>
> %pre
> getent group orca >/dev/null || groupadd -r orca
> getent passwd orca >/dev/null || useradd -r -g orca -d /var/orca -s
> /bin/bash -c "Orca Application User" orca
>
> This works fine for when the package is installed in the %post or even
> after installation.
>
> However when i put this package into the %packages section of my
> kickstart the package fails to install with
>
> Installing procallator - 1.0-6.noarch
> /var/tmp/rpm-tmp.18620: line 1: groupadd: command not found
> /var/tmp/rpm-tmp.18620: line 2: useradd: command not found
> error: %pre(procallator-1.0-6.noarch) scriptlet failed, exit status 127
> error:   install: %pre scriptlet failed (2), skipping procallator-1.0-6
>
> Now i presume this is something to do with groupadd and useradd not
> being available in anaconda, if so how can i resolve this so that this
> can be installed in the %packages section or later on with yum without
> changing the package?
>
> thanks
>
> _______________________________________________
> Kickstart-list mailing list
> Kickstart-list at redhat.com
> https://www.redhat.com/mailman/listinfo/kickstart-list
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/kickstart-list/attachments/20090409/3f5f7243/attachment.htm>


More information about the Kickstart-list mailing list