[RC5] Auto starting client in Linux

Chris.Arguin at unh.edu Chris.Arguin at unh.edu
Thu Sep 3 16:02:45 EDT 1998

On Wed, 2 Sep 1998, Bryan Craig Edwards wrote:

> Can someone please tell me how to start the rc5 client in Linux
> automatically when the computer boots up?  How do I supress the console
> output?

The command line I use is:
  su nobody -c "/home/rc5/rc5des -l rc5.log -quiet -exitfilechecktime 1 &"

That's a bit complicated. Basically, it runs rc5des as user nobody, to
reduce the amount of problems that could arise. Information is logged to
rc5.log, and the -quiet stops the stdout output.

It's a short enough script I'll include it here. This is for people using
a SysVInit, like RedHat. It's not perfect... I'd prefer it waited until
rc5des actually shutdown before exiting, but it wasn't worth that hassle.
This script exist as /etc/rc.d/init.d/rc5 on my system. The rc5 binary in
installed in /home/rc5 (something I've been meaning to fix as well...).

How would people feel about a binary RPM for rc5? Something that put
rc5des in /usr/bin, a log in /var/log, the buffers in /var/spool maybe, or
perhaps just /tmp, the rc5.ini in /usr/etc, the documenation in /usr/doc,
and setup a script file like the one below. That would make it easier for
linux newbies to get the script automatically started... and I know that I
have dispared at upgrading rc5 a few times... the tar filenames don't give
a hint at the version number. If this is something people seem to want,
I'll start to work on it.

# rc5   Start up distributed.net's rc5 client

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up... You might want to comment this line out.
[ ${NETWORKING} = "no" ] && exit 0

[ -f  /home/rc5/rc5des ] || exit 0

# See how we were called.
case "$1" in
        # Start daemons.
        echo -n "Starting DES/RC5: "
	cd /home/rc5         
        rm -f exitrc5.now
        [ -f /var/lock/subsys/rc5 ] && exit 0
        su nobody -c "/home/rc5/rc5des -l rc5.log -quiet -exitfilechecktime 1 &"
        echo "rc5des"
        touch /var/lock/subsys/rc5
	cd -
        # Stop daemons.
        echo -n "Shutting down DES/RC5: "
        cat /dev/null > /home/rc5/exitrc5.now
        echo "done"
        rm -f /var/lock/subsys/rc5
        echo "Usage: rc5 {start|stop}"
        exit 1

exit 0

Chris Arguin                 | "...All we had were Zeros and Ones -- And 
Chris.Arguin at unh.edu         |  sometimes we didn't even have Ones."
                             +--------------+	- Dilbert, by Scott Adams
http://leonardo.sr.unh.edu/arguin/home.html |

To unsubscribe, send 'unsubscribe rc5' to majordomo at lists.distributed.net
rc5-digest subscribers replace rc5 with rc5-digest

More information about the rc5 mailing list