User avatar
kyrios
Posts: 1499
Joined: Thu Sep 22, 2016 4:20 pm

useradd in a solus package ?

Thu Mar 16, 2017 8:34 pm

Hello!

I am trying to build a solus package for an application that requires a dedicated user/group to exists for the make install to succeed (the application refuses to install itself as root)

So the user and group must be created by the package if they don't already exist. But the package fails to build with the following error when it has to execute the useradd command:

Code: Select all

useradd: PAM: Authentication service cannot retrieve authentication info
How can I solve this please?

sunnyflunk
Development Team
Posts: 2747
Joined: Sun Mar 13, 2016 11:35 pm

Re: useradd in a solus package ?

Thu Mar 16, 2017 11:42 pm

kyrios wrote:
Thu Mar 16, 2017 8:34 pm
Hello!

I am trying to build a solus package for an application that requires a dedicated user/group to exists for the make install to succeed (the application refuses to install itself as root)

So the user and group must be created by the package if they don't already exist. But the package fails to build with the following error when it has to execute the useradd command:

Code: Select all

useradd: PAM: Authentication service cannot retrieve authentication info
How can I solve this please?
You use sysusers.d files to make users and groups (and they are removed when it's uninstalled. See https://git.solus-project.com/packages/ ... d.sysusers as an example and you can check out the package.yml for the package to see where it gets installed

User avatar
kyrios
Posts: 1499
Joined: Thu Sep 22, 2016 4:20 pm

Re: useradd in a solus package ?

Fri Mar 17, 2017 10:45 am

sunnyflunk wrote:
Thu Mar 16, 2017 11:42 pm
You use sysusers.d files to make users and groups (and they are removed when it's uninstalled. See https://git.solus-project.com/packages/ ... d.sysusers as an example and you can check out the package.yml for the package to see where it gets installed
Thanks! This looks indeed much cleaner and easier. But for some reason it doesn't seem to work... it looks like it doesn't create the user.

here is my sysusers.d file:

Code: Select all

u privoxy - "privoxy proxy"
g privoxy - -
m privoxy privoxy

here is my package.yml:

Code: Select all

name       : privoxy
version    : 3.0.26
release    : 1
source     :
    - https://www.privoxy.org/sf-download-mirror/Sources/3.0.26%20%28stable%29/privoxy-3.0.26-stable-src.tar.gz : 57e415b43ee5dfdca74685cc034053eaae962952fdabd086171551a86abf9cd8
license    : GPL-2.0
component  : network.clients
summary    : Non-caching web proxy with advanced filtering capabilities
description: |
    Privoxy is a non-caching web proxy with advanced filtering capabilities for enhancing privacy, modifying web page data and HTTP headers, controlling access, and removing ads and other obnoxious Internet junk. Privoxy has a flexible configuration and can be customized to suit individual needs and tastes. It has application for both stand-alone systems and multi-user networks.
setup      : |
    %reconfigure --disable-static
build      : |
    %make
install    : |
    install -Dm00644 $pkgfiles/privoxy.sysusers $installdir/%libdir%/sysusers.d/privoxy.conf
    %make_install USER=privoxy GROUP=privoxy

and here is the error I get:

Code: Select all

+ install -Dm00644 /home/build/work/files/privoxy.sysusers /home/build/YPKG/root/privoxy/install//usr/lib64/sysusers.d/privoxy.conf
+ make -j5 install DESTDIR=/home/build/YPKG/root/privoxy/install USER=privoxy GROUP=privoxy -s
id: 'privoxy': no such user
make: *** [GNUmakefile:801: install] Error 1
Command '['/bin/bash', '--norc', '--noprofile', '/tmp/ypkg-installQ_T8zs']' returned non-zero exit status 2
[Build] install failed
ERRO[10:34:25] Failed to build package                       error="exit status 1"
ERRO[10:34:27] Failed to build packages
...

sunnyflunk
Development Team
Posts: 2747
Joined: Sun Mar 13, 2016 11:35 pm

Re: useradd in a solus package ?

Fri Mar 17, 2017 12:39 pm

It can't create a user in solbuild as the build user has no permissions. It puts the file in the eopkg so the users are created when it's installed.

It likely needs patching if that's the case

Return to “Engagement”