Hi guys,
i want to reload apache trrough my
java application on opensuse server.My .sh file placed on the path "/usr/share/tomcat6/ ". I am using following code but the output printed on
tomcat log is " null "
Runtime runtime = Runtime.getRuntime();
Process process = runtime.exec("sh apacheReload.sh");
process.waitFor();
InputStream is = process.getInputStream();
InputStreamReader isr = new InputStreamReader(is);
BufferedReader br = new BufferedReader(isr);
System.out.println("><><>apache restart<><><>"+br.readLine());
where apacheReload.sh is my bash file that contains:-
#! /bin/bash
/etc/init.d/apache2 reload
But when i try to reload the apache through" sh apacheReload.sh" on console it works fine.
Regards,
Manpreet