Letting FZSknow I've changed the XML-file

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
Klimaks
500 Command not understood
Posts: 4
Joined: 2004-06-23 08:51

Letting FZSknow I've changed the XML-file

#1 Post by Klimaks » 2004-06-24 10:11

I've made an ASP script that adds users to the FZS XML file. To be able to use this users i've to stop and start the FZS service. Is there another way?

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

#2 Post by botg » 2004-06-24 11:15

Search the forums, this has been asked before. You can use the -reload-config command line switch.

Klimaks
500 Command not understood
Posts: 4
Joined: 2004-06-23 08:51

#3 Post by Klimaks » 2004-07-01 08:28

This seems to work fine when I run it from windows. But when I try to execute the command from ASP, FZS will not accept the new password.

I use the following code

Dim WshShell, oExec
Set WshShell = CreateObject("WScript.Shell")
path = chr(34) & "C:\Program Files\FileZilla Server\filezilla server.exe" & chr(34) & " /reload-config"
Set oExec = WshShell.Exec(path)

Do While oExec.Status = 0

Loop

response.write oexec.status & "<br>"
response.write oexec.exitcode & "<br>"
response.write oexec.processid & "<br>"

When I run the asp without the /reload-config parameter, the process shows up in my taskmanager, so IIS is able to lauch the exe...

What am i doing wrong?


I've found out what the problem is. You use FindWindow to locate FZS window to send a message to tell FZS to reload the config. But IIS is running in another windowstation as the interactive user and will not find that window, therefore it cannot send the message to reload the config.

Is there another possibility?

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

#4 Post by botg » 2004-07-01 14:28

Please redownload version 0.9.1, I made a silent update.

-reload-config should now work if being called from a non-interactive process.

You may also open the service directly and pass control code 128 to ControlService to reload the config.

Klimaks
500 Command not understood
Posts: 4
Joined: 2004-06-23 08:51

#5 Post by Klimaks » 2004-07-01 14:57

botg wrote:Please redownload version 0.9.1, I made a silent update.

-reload-config should now work if being called from a non-interactive process.

You may also open the service directly and pass control code 128 to ControlService to reload the config.
Yes it works, thank you so very much :)

I don't understand a thing though about your control code mumbo yumbo :wink:

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

#6 Post by botg » 2004-07-01 15:22

I don't understand a thing though about your control code mumbo yumbo :wink:
Indeed, that's big bad voodoo. Take your voodoo doll and read this:
http://msdn.microsoft.com/library/defau ... ervice.asp

LunarRunner
500 Command not understood
Posts: 1
Joined: 2005-03-11 20:45
Location: Layton, UT

reload-config appears to be broken in 9.5

#7 Post by LunarRunner » 2005-03-11 21:13

First, my problem is with FZS version 9.5. I have written some configuration scripts to update the FileZilla Server.xml file but using the /reload-config option doesn't work for me. In an attempt to fix this, I downloaded the source code and made some minor changes to the reload logic. I was able to get the reload working by making the CServer instance variable "pServer" global in the Service.cpp module, and then by adding a method "CServer::ReloadConfig()" in Server.cpp to perform the reload operation. The service control handler was then modified to make the call directly. The service control handler now looks like this for the custom service control:

case 128:
pServer->ReloadConfig();
break;

The added method in Server.cpp looks like this:

void CServer::ReloadConfig()
{
COptions options;
options.ReloadConfig();
CPermissions perm;
perm.ReloadConfig();
}

This works just fine on both XP and 2003 server. However, on 2003 server, my build crashes when I attempt to make an FTP connection so I think I my build is not quite right. Also, I'm not sure this method will work properly for larger installations as the time it takes to reload the configuration may exceed the service control hint timeout, causing the service to appear non-responsive. However, I've always avoided using windows messaging to communicate between threads in services and find this to be a better solution; perhaps using a named event might work equally well.

Since I can't deploy my build on 2003 server because it crashes upon FTP connections, and I can't use the FZS distribution without the /reload-config option working, I'm stuck.

BTW, you might be asking "If the build crashes, how can he say the reload modifications worked?" Well, on XP (my build machine), it works just fine. I can reload the configuration and make FTP connections all day long. When I move my build to a 2003 server platform, the build crashes when I make an FTP connection to the server. Also note that the production release will run properly on a 2003 server, but not my build.

Any ideas?

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

#8 Post by botg » 2005-03-12 00:08

I finally found out why /reload-config was not working. It did break it when I improved the message handling in FZS to be more reliable. A proper fix is available in CVS.

Post Reply