Dnet Client In Linux

Version 2.1 - May 8, 2000

Created by The King Ant/Maintained by BPhantom - Team AnandTech

This HOWTO shows you how to install, setup, and auto-start the
DNET client in Linux. This HOWTO is exampled in a RedHat install, using
a x86 machine, with glib2.1 installed. A few parameters might/will be
incorrect for a different Linux distribution.

All commands are expressed in "()"'s. Please do not include them on the
command line. =)


** Installing the client **

Make the directory /var/dnetc: (mkdir /var/dnetc)

Download the corrent Linux DNET client from Distributed.net:
http://www.distributed.net/download/clients.html. Get the
x86/ELF/glibc2.1/MT distribution. Save it in the directory /var/dnetc
(the one you just made).

Move into the directory: (cd /var/dnetc)
Decompress the client: (tar zxvf dnetc-linux-x86-glibc21.tar.gz) <--or
whatever the name of the file is.


** Configuring the Client **

Run the client: (./dnetc -config)

Go ahead and set whichever options look interesting. Option #1, Item #1
is the most critical (as if I needed to tell you that!). Save the
settings and exit. Note: If you need to reconfigure it later, just run
(./dnetc -config). If the configuration is completed screwed up, just
(rm dnetc.ini) and start over with (./dnetc -config).


** Testing out the Client **

Before starting the client, be sure you are connected to the Internet or
have some other way to retrieve buffers (either from D.Net or a personal
proxy). Run (./dnetc) again to test it. If the client started up,
possibly retrieved some blocks, and should now be crunching on a block;
you are good to go! Go ahead and press CTRL+C to shutdown the client for
now.


** Setting the client to auto-start on bootup **

Depending if your machine is used by other people, it would be an
excellent idea to adjust the file permissions. Run:
(chmod 640 /var/dnetc/*) This will set all files to read/write for you,
read only for group, and no access for anyone else.

With the buffers and the ini file in /var/dnetc, you can move the
executable into a bin directory. I used /usr/local/bin
(mv dnetc /usr/local/bin) and enable the executable file permission
by (chmod 750 /usr/local/bin/dnetc).

Now to get it to start when Linux boots up: Edit /etc/rc.d/rc.local, I
used pico: (pico /etc/rc.d/rc.local) Place the following line's
somewhere near the bottom of this file:

# DNET client
echo "Starting DNET client"
/usr/local/bin/dnetc -ini /var/dnetc/dnetc.ini -quiet

Or better yet, instead of the above line, you can redirect the output to
a virtual terminal:

/usr/local/bin/dnetc -ini /var/dnetc/dnetc.ini -noquiet >> /dev/tty8 &

*This is important!* Don't forget the "&"!!! The "&" will run DNETC as a
background process and allow Linux to finish booting up. Otherwise it
will lock your machine in the DNET client with CTRL+C unable to break
out of it. This can be fixed either by rebooting and at the lilo bootup
prompt issue: (linux 1) which puts it into single user mode. Or if
your machine is networked, telnet/ssh into the box and fix
/etc/rc.d/rc.local.

A little background info on virtual terminals: In case you haven't heard,
Linux allows you to have "virtual terminals." Basically it's like a bunch
of different local login's (you can only have 1 Xwindows at a time
though). You can switch between the terminals using CTRL+ALT from
Xwindows, or just ALT if you're at a shell. In Xwindows, hit CTRL+ALT+F2
to try it out and then CTRL+ALT+F7 to get back to Xwindows. Note:
Xwindows isn't always on F7. The left and right sets of CTRL and ALT take
you to different virtual terminals. Left is 1-12 and right is 13-24.

Save /etc/rc.d/rc.local (CTRL-X in pico) and restart the machine (or just
type the above line at the command prompt if you have a nice uptime ;-)).
To check if it's running, issue (ps aux | grep dnetc.) A single CPU
machine will show three processes of dnetc, dual CPU machine will show
four. Two of the processes are input/output buffer activity and the
remaining process(es) are the active block crunchers.

If you chose to direct the output to a virtual terminal: In X,
CTRL+ALT+F8 to view the DNETC output and then ALT+F7 to get back into X.
In shell (text) mode, ALT+F8 to view the DNETC output and then ALT+F1 to
get back to your shell. Another way to check is to enable the log file.
The default is no logging (to enable logging,
(dnetc -config -ini /var/dnetc/dnetc.ini), option #4, set #1 to whatever
you want, set #2 to the log file name you want to generate, return to
menu, save, (dnetc -restart)). The log file you configured should now
exist and can be viewed.

If you need to shutdown/kill the client, you must be logged into the same
user account DNETC was started from (that or supercede everything by using
root). Run (dnetc -shutdown). If the client continues to run, issue
(killall -TERM dnetc). A (killall -9 dnetc) can be used if the client
refuses to shutdown.