Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 43117 - error in freenet-0.5.2.1-r8.ebuild (wrong usage of usermod)
Summary: error in freenet-0.5.2.1-r8.ebuild (wrong usage of usermod)
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All All
: High normal (vote)
Assignee: Jeremy Huddleston (RETIRED)
URL:
Whiteboard:
Keywords:
: 43109 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-02-27 11:06 UTC by Christoph Gysin
Modified: 2004-02-28 03:21 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Christoph Gysin 2004-02-27 11:06:52 UTC
when emergeing freenet-0.5.2.1-r8, the process fails if the user freenet already exists.

!!! ERROR: net-p2p/freenet-0.5.2.1-r8 failed.
!!! Function pkg_preinst, Line 49, Exitcode 9
!!! Failed to create freenet user

in the ebuild:
pkg_preinst() {
    if ! groupmod freenet > /dev/null 2>&1; then
        groupadd freenet 2> /dev/null || \
        die "Failed to create freenet group"
    fi
    if ! usermod freenet > /dev/null 2>&1; then
        useradd -g freenet -s /bin/bash -d /var/empty \
            -c "freenet" freenet 2> /dev/null || \
            die "Failed to create freenet user"
    else
        usermod -s /bin/bash freenet
    fi
}

the check for the group groupmod works, but not for usermod.

# usermod freenet
usermod: no flags given

solution:
use another method to check if the user already exists
Comment 1 SpanKY gentoo-dev 2004-02-27 20:43:19 UTC
should probably use `enewuser` and `enewgroup`
Comment 2 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-28 01:32:50 UTC
fixed.
Comment 3 Jeremy Huddleston (RETIRED) gentoo-dev 2004-02-28 03:21:52 UTC
*** Bug 43109 has been marked as a duplicate of this bug. ***