> Dave,
>
> Thanks. I was asking if I need to call any function in
> the java code if I want to restart the node.  I don't
> know if someone is attacking me or what, my node is getting
> slow over time. I saw a lot of tcp connections in the
> CLOSE_WAIT state. So I want to restart the node automatically
> everyday.

The CLOSE_WAIT thing is a bug, as far as I can remember.  Could you make a
log of this bug in the bugtracker so that the appropriate freenet devs get
awareness of the problem:

http://sourceforge.net/tracker/?func=browse&group_id=978&atid=100978

>
> If I just kill the java process and restarted, it seems to
> mess up the data store. Some times fproxy does not start
> after this.
>
> Yuan

I don't know why it messes up the data store, but I can probably guess:
Killing a process is generally a bad idea (I can't remember if you said you
were using Windows or a *nix variant operating system) no matter what
operating system (but especially Windows as the operating system doesn't
garbage-collect stray file handles and lost memory)

The way the freenet tray utility works under Windows is to send a windows
message to the (hidden) gui node.
What I mean is, the freenet tray utility secretly runs "java
Freenet.node.gui.GUINode"  (not "java Freenet.node.Node").  This creates a
gui interface to the Freenet node.  The tray utility creates this hidden so
the user cannot see it, but it's there, I assure you.   The freenet tray
utility then (in response to the use clicking on "Stop Freenet") tells this
window to close itself, and this in turn causes the freenet node to stop
itself, CLEANLY.

If you want to do something similar to safely shut down and restart the
freenet node, you can run "java Freenet.node.gui.GUINode" from the command
line instead of "java Freenet.node.Node" (if you're using Windows, do this
instead of using the freenet systray utility) and then, when you want to
shut the node down, close the window that appeared.

Closing the GUINode window can be automated under Windows (the freenet tray
utility does a number of clever things to achieve this, but essentially all
it is really doing is sending the "WM_SYSCOMMAND[SC_CLOSE]" message to all
the windows created by the java process. Although my tip for the day is to
only send this to windows that have a message pump associated to them
otherwise Windows 'helpfully' pops up a message saying 'this window cannot
be closed automatically ....' .   Check out the source code for the freenet
tray utility if you're interested in this sort of thing)

I honestly don't know about *nix  (and I currently don't have access to a
box) but I'm pretty safe in assuming that it's straightforward to automate
closing a simple java gui window given a decent window manager under *nix
(my logic here generally goes along the lines of "If you can do it in
Windows, you can almost certainly do it in *nix, but buggered if I know
how")


Hope this helps some,

Dave


_______________________________________________
Support mailing list
[EMAIL PROTECTED]
http://lists.freenetproject.org/mailman/listinfo/support

Reply via email to