| 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] Server | Assignee: | 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 | ||
Created attachment 58441 [details, diff]
new init-script
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 ? 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.
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... i already said why su fails to work |
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>