Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!

Bug 91974

Summary: The entropy init-script does not start entropy and just fails without any error message.
Product: Gentoo Linux Reporter: Bartek Kostrzewa <bartek>
Component: [OLD] ServerAssignee: SpanKY <vapier>
Status: RESOLVED DUPLICATE    
Severity: normal    
Priority: High    
Version: unspecified   
Hardware: x86   
OS: Linux   
Whiteboard:
Package list:
Runtime testing required: ---
Attachments: new init-script

Description Bartek Kostrzewa 2005-05-08 23:26:45 UTC
I rewrote the init script so it uses sudo rather than su, now it works wonderfully. Also, instead of using entropy --kill to stop, I use killall -w entropy.



Reproducible: Always
Steps to Reproduce:
start entropy, see it fail




<tt>
#!/sbin/runscript
# Copyright 1999-2004 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/net-misc/entropy/files/entropy.rc,v 1.2
2004/07/14 23:57:55 agriffis Exp $

depend() {
        need net
        use mysql
}

checkconfig() {
        local HOME="`getent passwd ${ENTROPY_USER} | cut -d: -f 6`"
        if [ ! -d ${HOME} ] ; then
                mkdir -p ${HOME}
                chown ${ENTROPY_USER} ${HOME}
        fi
        cd ${HOME}
}

start() {
        checkconfig || return 1
        ebegin "Starting entropy"
        sudo -u ${ENTROPY_USER} nice -n 15  entropy &
        eend $?
}

stop() {
        ebegin "Stopping entropy"
        sudo -u ${ENTROPY_USER} killall -w entropy
        eend $?
}
</tt>
Comment 1 Bartek Kostrzewa 2005-05-08 23:32:38 UTC
Created attachment 58441 [details, diff]
new init-script
Comment 2 SpanKY gentoo-dev 2005-05-08 23:55:21 UTC
su fails because the user is added with a /bin/false shell ...

sudo isnt standard on all systems, so we'd have to force it into RDEPEND ... too bad entropy doesnt support changing userid via config file ... or does it ?
Comment 3 Bartek Kostrzewa 2005-05-09 00:23:49 UTC
No, it does not have a config option like that. The sudo idea is taken from the freenet init script. Unfortunately the original 

su - ${ENTROPY_USER} entropy 

implementation does not seem to work for me as the entropy user has no home directory, shell etc.. and it would be too risky to change that anyway

Also, stopping with entropy --kill or -k works, but only if the entropy daemon is not busy updating the store. I guess there should be a dual mechanism for stopping it so that it can be killed if it fails to kill itself.
Comment 4 Bartek Kostrzewa 2005-05-09 00:33:42 UTC
Hmm.. I just noticed that in /etc/passwd entropy has a home directory in /var/entropy ... i'm wondering why the su implementation does not work then...
Comment 5 SpanKY gentoo-dev 2005-05-09 04:36:33 UTC
i already said why su fails to work
Comment 6 SpanKY gentoo-dev 2005-10-13 21:17:07 UTC

*** This bug has been marked as a duplicate of 100780 ***