You are not logged in.

#1 2020-10-17 07:17:06

MountainX
Member
Registered: 2016-02-08
Posts: 261

[SOLVED] extra-x86_64-build: chgrp: invalid group

I have a custom package that calls chgrp in the install script's post_install function. The required group needs to be added in the chroot env. What is the proper way to do that?

This is what my error looks like currently:

==> Starting pkgver()...
==> Entering fakeroot environment...
==> Starting package()...
chgrp: invalid group: ‘staff’
==> ERROR: A failure occurred in package().
    Aborting...
==> ERROR: Build failed, check /mnt/chroots/arch/extra-x86_64/myuser/build

EDIT: I have another package that creates the needed group, and it is a dependency of this package, but running extra-x86_64-build on that dependency first does not resolve the error, so I tried installing the dependency into the chroot like this (as shown under handling major rebuilds)

cd /path/to/dependency-pkg
makechrootpkg -n -r $CHROOT
sudo chroot $CHROOT/myuser
# getent group staff
staff:x:1047:

The group has apparently been added but I continue to get the above failed build due to invalid group staff.

chgrp: invalid group: ‘staff’

To the mods: I guess this question should have been posted in Creating & Modifying Packages, right? If so, can you move it for me? Thanks.

Last edited by MountainX (2020-10-18 16:55:42)

Offline

#2 2020-10-18 03:35:12

eschwartz
Trusted User/Bug Wrangler
Registered: 2014-08-08
Posts: 3,768

Re: [SOLVED] extra-x86_64-build: chgrp: invalid group

MountainX wrote:

I have a custom package that calls chgrp in the install script's post_install function. The required group needs to be added in the chroot env. What is the proper way to do that?

This is what my error looks like currently:

==> Starting pkgver()...
==> Entering fakeroot environment...
==> Starting package()...
chgrp: invalid group: ‘staff’
==> ERROR: A failure occurred in package().

This is in package() not in the install script, so I'm not sure what's going on here?

Generally, you cannot assume groups exist during the packaging, and pacman doesn't even use them -- it uses numeric uid/gid for extraction. For official packages there is https://wiki.archlinux.org/index.php/De … D_Database but ideally packages would not need to install files as a specific user.

You could use sysusers.d to create the user and tmpfiles.d to set up data directories etc. and depending on the specific use case I'd advise this as the first approach to try to take.

MountainX wrote:

To the mods: I guess this question should have been posted in Creating & Modifying Packages, right? If so, can you move it for me? Thanks.

You could use the report post feature for this to ensure they notice. I've done so for you.


Managing AUR repos The Right Way -- aurpublish (now a standalone tool)

Offline

#3 2020-10-18 05:17:17

ewaller
Administrator
From: Pasadena, CA
Registered: 2009-07-13
Posts: 17,513

Re: [SOLVED] extra-x86_64-build: chgrp: invalid group

Moving, by request.


Nothing is too wonderful to be true, if it be consistent with the laws of nature -- Michael Faraday
Sometimes it is the people no one can imagine anything of who do the things no one can imagine. -- Alan Turing
---
How to Ask Questions the Smart Way

Offline

#4 2020-10-18 16:55:23

MountainX
Member
Registered: 2016-02-08
Posts: 261

Re: [SOLVED] extra-x86_64-build: chgrp: invalid group

eschwartz wrote:

This is in package() not in the install script, so I'm not sure what's going on here?

That was my problem. I was doing something in the package() function that shouldn't have been done there. It was responsible for several problems. I moved that functionality to the install script and the problem was resolved.

Offline

Board footer

Powered by FluxBB