Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 501924 - net-misc/rwhoisd - init script should use "--" to separate rwhoisd's arguments from start-stop-daemon's arguments
Summary: net-misc/rwhoisd - init script should use "--" to separate rwhoisd's argument...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Server (show other bugs)
Hardware: AMD64 Linux
: Normal normal (vote)
Assignee: No maintainer - Look at https://wiki.gentoo.org/wiki/Project:Proxy_Maintainers if you want to take care of it
URL:
Whiteboard:
Keywords: PATCH
Depends on:
Blocks:
 
Reported: 2014-02-20 19:50 UTC by Joshua Coombs
Modified: 2014-11-09 10:43 UTC (History)
1 user (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 Joshua Coombs 2014-02-20 19:50:51 UTC
Two bugs that render this app unusable as installed:

1) /etc/init.d/rwhoisd does not use -- to separate the daemon's arguments from the stop-stop-daemon's args, resulting in -c <path to rwhoisd conf> being misinterpreted as a faulty chroot user.

Current:
start() {
	ebegin "Starting rwhoisd"
	start-stop-daemon --start --quiet --exec /usr/sbin/rwhoisd ${RWHOISD_OPTS}
	eend $?
}

Should be:
start() {
	ebegin "Starting rwhoisd"
	start-stop-daemon --start --quiet --exec /usr/sbin/rwhoisd -- ${RWHOISD_OPTS}
	eend $?
}


2) The mkdb toolkit relies on the system sort binary, but by default calls it using inappropriate syntax.  There is a define in place with functional syntax, but I don't see any means of triggering it.  Without fixing this, rwhoisd will fail to return responses to queries and the indexing tools will error out without building new indexes.

Current rwhoisd-1.5.9.5/mkdb/index.c:

#ifdef NEW_STYLE_BIN_SORT
#define SORT_COMMAND "sort -o %s -k 5,5 -k 4,4n -t : %s"
#else
#define SORT_COMMAND "sort -o %s +4 +3 -t : %s "
#endif

If you change the second define to match the one inside the ifdef block, everything works like it's supposed to.
Comment 1 Joshua Coombs 2014-02-20 19:51:47 UTC
Error output calling /etc/init.d/rwhoisd:
# /etc/init.d/rwhoisd start
 * Caching service dependencies ...                                                                                 [ ok ]
 * Starting rwhoisd ...
 * WARNING: -c/--chuid is deprecated and will be removed in the future, please use -u/--user instead
 * start-stop-daemon: user `/etc/rwhoisd/rwhoisd.conf' not found                                                    [ !! ]
 * ERROR: rwhoisd failed to start
Comment 2 Joshua Coombs 2014-02-20 19:52:43 UTC
Example error output from rwhois_indexer if sort define isn't updated:
# bin/rwhois_indexer -c /etc/rwhoisd/rwhoisd.conf -i -v  -s txt
sort: cannot read: +4: No such file or directory
error: sort failed: Success
warning: could not delete temporary index file '': Success
warning: could not delete temporary index file '': Success
indexing failed
Comment 3 Jeroen Roovers (RETIRED) gentoo-dev 2014-11-09 10:43:54 UTC
Should be all set in -r2. Thanks for the report.