Java - Groovy exec() not working for /reload-config

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
zermattchris
500 Command not understood
Posts: 4
Joined: 2010-05-06 07:20
First name: Chris
Last name: Banford

Java - Groovy exec() not working for /reload-config

#1 Post by zermattchris » 2010-05-16 21:00

Hi 'Zilla gang,

This has been driving me completely batty, and none of the Java/Groovy gurus on the dev list can figure it out either (I've spent days trying to get what I thought was something simple to work! Grrr).

When trying to call the /reload-config command from Groovy (Java) on FileZilla Server it fails, in weird and not so wonderful ways.

I'm getting a return code of '1' for /reload-config (fail)
but...
if I change it to /stop or /start -- all works as it should.

I'm trying to add new user accounts to Server by changing the FileZilla Server.xml file, and then wanted to reload these settings.

Groovy code:

Code: Select all

		def ant = new AntBuilder() 
		ant.exec(	outputproperty:"cmdOut",
		            errorproperty: "cmdErr",
		            resultproperty:"cmdExit",
		            failonerror: "false",
		            dir: "c:\\Program Files\\FileZilla Server",
		            executable: 'cmd.exe' 
				)
				{
					//  /reload-config fails, while /start and /stop work ok
					arg( line: """/c "FileZilla Server.exe" /reload-config""" )
				}
		
		println "return code:	${ant.project.properties.cmdExit}"
		println "stderr:		${ant.project.properties.cmdErr}"
		println "stdout:		${ant.project.properties.cmdOut}"
		
I know this is a long shot, but does anyone have an idea why this is failing? Running from the Windows command line and/or from a bat script works as expected, just not from the Groovy code.

Any flashes of brilliance would be hugely appreciated!

Cheers,
-Chris

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

Re: Java - Groovy exec() not working for /reload-config

#2 Post by botg » 2010-05-17 06:28

Probably a permissions issue. Does your Java program as well as your JVM have permissions to enumerate the windows of processes running under a different account and to post messages to these?

Post Reply