rwhois question (non linux savy user)

Kris Deugau kdeugau at vianet.ca
Tue Dec 5 13:09:01 EST 2006


Michael R. Overholser wrote:
> I got rwhois installed and running finally, however, I cannot get it to 
> run automatically (as a daemon) when the system boots. I am running the 
> newest version of rwhois, on FC6

The simplest way on most RedHat derivatives is to add a line to 
/etc/rc.d/rc.local:

/path/to/rwhoisd -d

You may need to add other options to get it to run correctly, YMMV, etc, 
etc.  (Fortunately, you've picked a distro that *has* this file;  Debian 
doesn't have any equivalent I've been able to find.)

For a complete init script, drop the attached into /etc/rc.d/init.d. 
You'll need to change a few paths to match your install location, and to 
get it running on boot you'll need to run "chkconfig --add rwhoisd".

-kgd
-------------- next part --------------
#!/bin/sh
# Quick hack init script for rwhoisd
# Kris Deugau <kdeugau at vianet.ca> 2006
##
# bits for chkconfig to chew on
# chkconfig: 345 99 01
# description: The Referral WHOIS daemon
# processname: rwhoisd
##
# rwhoisd script for /etc/rc.d/init.d
# Source init.d functions...
. /etc/rc.d/init.d/functions

case "$1" in
  start)
	echo -n "Starting rwhoisd..."
	/usr/sbin/rwhoisd -d -c /etc/rwhoisd/rwhoisd.conf &
	RETVAL=$?
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/rwhoisd
	[ $RETVAL -eq 0 ] && echo_success || echo_failure
	echo
	;;
  stop)
	echo -n "Stopping rwhoisd..."
	killproc rwhoisd
	RETVAL=$?
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/rwhoisd
	echo
	;;
  restart)
	$0 stop
	$0 start
	;;
  *)
	echo "Usage: rwhoisd {start|stop|restart}"
	;;
esac

exit $RETVAL


More information about the Rwhois mailing list