Letting FZSknow I've changed the XML-file
Moderator: Project members
Letting FZSknow I've changed the XML-file
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?
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?
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?
Yes it works, thank you so very muchbotg 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.
I don't understand a thing though about your control code mumbo yumbo
Indeed, that's big bad voodoo. Take your voodoo doll and read this:I don't understand a thing though about your control code mumbo yumbo
http://msdn.microsoft.com/library/defau ... ervice.asp
-
- 500 Command not understood
- Posts: 1
- Joined: 2005-03-11 20:45
- Location: Layton, UT
reload-config appears to be broken in 9.5
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?
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?