When emerging asterisk with the -G option, the environment for running asterisk is not fully set up and therefore there is a "group & user does not exist" error. From my observations, this is what is happening: In the src_install() stage is where the ebuild creates the astrisk group and user. But, when installing a binary directly, the src_unpack() compile() and install() stages are skipped. As a result, the user does not get added. Reproducible: Always Steps to Reproduce: 1.emerge -G asterisk 2. 3. Actual Results: asterisk is installed, but cannot run. Expected Results: The ebuild should have a pkg_preinst() stage to add the group and user. That way, the step will always be done.
by taking these line out of the src_compile stage, the problem is gone: pkg_preinst() { einfo "adding asterisk user and group" if [[ -z "$(egetent passwd asterisk)" ]]; then einfo "Adding asterisk user and group" enewgroup asterisk enewuser asterisk -1 /bin/false /var/lib/asterisk asterisk fi # fix permissions for x in spool run lib log; do chown -R asterisk:asterisk ${D}/var/${x}/asterisk chmod -R u=rwX,g=rX,o= ${D}/var/${x}/asterisk done chown -R root:asterisk ${D}/etc/asterisk chmod -R u=rwX,g=rX,o= ${D}/etc/asterisk }
moved parts from src_install into pkg_preinst, thanks, fixed