Is reinstall necessary to implement -Xrs in .ini file? - Advanced Installer Community

We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

micksear
Posts: 2
Joined: Fri Sep 09, 2011 4:16 pm

Is reinstall necessary to implement -Xrs in .ini file?

I've encountered the common issue of my service stopping when a user logs out from Windows Server (or in, apparently) using RDP.

I discovered the "Reduced usage of operating-system signals" option via the forums, and also discovered that this puts -Xrs in the wrapper's ini file. Thinking that this would be enough for the client having the problem, we added that option to the .ini file and restarted the service. However, the client is still complaining that the service is restarting when they log out.

I need to understand how this ini file is used during operation - is it read by the .exe file every time the service is started, or is it only used when the service is restarted?

I'm using Advanced Installer 7.6.1
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Is reinstall necessary to implement -Xrs in .ini file?

Hi,

The INI file is loaded by your application when you launch it. In this case the user must stop the service and start it manually, making sure
the new file contains the flag you've added.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
micksear
Posts: 2
Joined: Fri Sep 09, 2011 4:16 pm

Re: Is reinstall necessary to implement -Xrs in .ini file?

Thanks. I'm actually invoking Tomcat's startup.bat from the wrapper, so of course Tomcat probably also needs -Xrs in the command line. I've edited the catalina.bat in the Tomcat distribution I'm using and I'll try that out. Looking at my wrapper code, I'm not sure why the wrapper should stop if I have -Xrs in the .ini file (see below), even if Tomcat stops. There's nothing in the wrapper that checks that Tomcat is actually running. However, it does seem to be the case that the wrapper is stopping and then starting on logout.

Code: Select all

public class MyWrapper {
	
	public static boolean running = true;
	
	public static void main(String[] args) throws Exception {
		ProcessBuilder pb = new ProcessBuilder("tomcat/bin/startup.bat");
		pb.directory(new File("."));
		pb.environment().put("JRE_HOME", "jre6");
		pb.environment().put("CATALINA_HOME", "tomcat");
		Process proc = pb.start();
		
		String line;
		BufferedReader input = new BufferedReader(new InputStreamReader(proc.getInputStream()));
		while ((line = input.readLine()) != null) {
			System.out.println(line);
		}
		input.close();
		
		while(running){
			try{				
				Thread.sleep(500);				
			} catch (Exception e){
				e.printStackTrace();
			}
		}
	}

	public static void stop() throws IOException {		
		ProcessBuilder pb = new ProcessBuilder("tomcat/bin/shutdown.bat");
		pb.directory(new File("."));
		pb.environment().put("JRE_HOME", "jre6");
		pb.environment().put("CATALINA_HOME", "tomcat");
		pb.redirectErrorStream(true);

		Process proc = pb.start();
		String line;
		BufferedReader input = new BufferedReader(new InputStreamReader(proc
				.getInputStream()));
		while ((line = input.readLine()) != null) {
			System.out.println(line);
			
		}
		input.close();
		running = false;
	}

}

Code: Select all

[Java Runtime Environment]
Maximum Version=any
JVM Source=favor_JDK
JVM Type=favor_server
Virtual Machine Parameters=-Xrs
Minimum Version=any
Main Class=service.MyWrapper
...

Return to “Common Problems”