Reload server from Java

Need help with FileZilla Server? Something does not work as expected? In this forum you may find an answer.

Moderator: Project members

Post Reply
Message
Author
pwraustin
500 Command not understood
Posts: 5
Joined: 2007-10-10 15:46

Reload server from Java

#1 Post by pwraustin » 2007-11-07 23:32

Hi, does any body try to reload the FileZilla server form java? I try with

Process p = Runtime.getRuntime().exec(new String[]{"C:\\..\\FileZilla Server\\FileZilla server.exe","/reload-config"});
System.out.println(p.waitFor());


If a exectue the comand without the parameter (/reload-config), the .exe is executed, but when I try with the parameter it doesn't work. The p.waitFor() returns 1.
Any clue?

Thanks in advance!

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

#2 Post by botg » 2007-11-07 23:46

What would the 1 be? Success or failure?

pwraustin
500 Command not understood
Posts: 5
Joined: 2007-10-10 15:46

#3 Post by pwraustin » 2007-11-08 00:20

The '1' is for failure sadly there is no more information provided by Java than if 0 is returned then is a succesfull execution otherwise not.
I check if the execution was succesfull throught the FileZilla Server Interface that doesn'r reflect my changes.
I'm writing on the FileZilla Server.xml file and then I try to reload the server.

Thanks

User avatar
botg
Site Admin
Posts: 35566
Joined: 2004-02-23 20:49
First name: Tim
Last name: Kosse

#4 Post by botg » 2007-11-08 10:56

Sadly I have no idea. But since Java is open source now, you could just step into the code with a debugger to see how and why it fails.

pwraustin
500 Command not understood
Posts: 5
Joined: 2007-10-10 15:46

#5 Post by pwraustin » 2007-11-08 12:26

Ok thanks anyway. If a solve my problem I'll post the solution.

Thanks

pwraustin
500 Command not understood
Posts: 5
Joined: 2007-10-10 15:46

#6 Post by pwraustin » 2007-11-09 15:24

I've finally made it work. The fact that Java returns 1 it doesn't mean that FileZilla server.exe /reload-config wasn't executed. In fact, it was.

The problem, I think is that in some occasions the reload doesn't reflect the changes in the XML config file. It could be maybe because I call the command several times very quickly.
When the change is not reflected, I wait until all my "Java work" finished and then I call from java the reload command one more time and works fine.
It could be maybe too, because some connections to the sever were opened at the time, and I modify the XML config file and reload the server several times.
Anyway, this scenarios are not very commons in my domain.

Thanks for all... excellent project.

Post Reply