Re: Recipes for automatically starting deschall (different OSes)

Dan Calle (
Sun, 20 Apr 1997 23:33:38 -0400 (EDT)

On Sun, 20 Apr 1997, Nelson Minar wrote:

> Here's my script:

I took your script and fleshed it out a bit
only thing I changed that might break anything was to use "nice -n 10"
instead of "nice -10" since the latter is apparently obsolescent syntax.

Here are some instructions and notes, the script follows.
Don't forget to delete my sig.

1) Edit the script and modify the variables at the top as needed.
2) su to root
3) rename the script to /sbin/init.d/deschall
4) chown bin.bin /sbin/init.d/deschall
5) chmod 750 /sbin/init.d/deschall
6) cd /sbin/rc3.d/
7) ln -s ../init.d/deschall Sxxdeschall
8) reboot to test OR just type /sbin/init.d/deschall start


- If you're only going to run the script manually, you only need to do step
- In step 7, replace "xx" by some number from 00..99. The rc scripts
execute every script in that directory in ascending order so you probably
want to name it something like S95deschall.init so that it runs after all
the important stuff. Just make sure the number isn't taken.

- To kill it, just type /sbin/init.d/deschall stop

Here's the script:

--------cut here--------cut here--------cut here--------cut here--------
#! /bin/sh
# <> quick hack up to start deschall nicely as user
# nobody, nice 19, and do logging.
# <> - modified to handle some errors, make it easier to change
# some parameters, fix it so it works with some other Unixen, implement
# the "stop" argument, and allow it to be run by normal users.
# more info on deschall is at

# Edit these to reflect your setup.

# You'll need to change this if user nobody has an invalid shell
# (often the case for security reasons) or if you're not going to be running th# is as root.

# This is an offset so, for example, since deschall runs niced to 10 by
# default, setting NICEOFFSET to 5 will result in deschall running niced
# to 15. The higher the nice level, the lower the priority.

# You probably don't need to modify anything beyond this point

case "$1" in
if [ ! -x $DESCHALL ]; then
echo "$0: ERROR: could not execute $DESCHALL"
exit 1
elif [ ! -d $LOGDIR ]; then
echo "$0: ERROR: $LOGDIR does not exist, unable to write log"
echo "$0: exiting"
exit 1
echo "Starting deschall to crack DES"

# create the logfile if it doesn't already exist
if [ ! -f $LOGPATH ]; then
touch $LOGPATH
echo "" >> $LOGPATH
echo "Starting deschall at `date`" >> $LOGPATH

# start the cracker as user DESUSER, niced to NICEOFFSET + 10
su $DESUSER -c "exec nice -n $NICEOFFSET $DESCHALL \
pid=`/bin/ps -e | grep $DESCHALL | grep -v grep | \
sed -e 's/^ *//' -e 's/ .*//' | head -1`
if [ "X$pid" != "X" ]; then
kill $pid
echo "" >> $LOGPATH
echo -n "Stopping deschall at `date`" >> $LOGPATH
echo "" >> $LOGPATH
echo "Usage: deschall {start|stop}"
exit 1

exit 0
--------cut here--------cut here--------cut here--------cut here--------

Dan Calle                        Senior, Computer Science, Virginia Tech
Email:                    Assistant Administrator: