Restart PADS from Java Program
Hi,
I am facing problems to restart PADS(Passive asset detection system) from java program.I used the root as a user. So from the command prompt I can start PADS with out sudo ,but when I try to start PADS from the my java program i.e. Process proc=Runtime.getRuntime().exec("pads restart"); It throws the error in log that FATAL error ! you not root and permission denied. Then I tried the same with sudo Process proc=Runtime.getRuntime().exec("sudo pads restart"; Here it create another two process extra 1 for stop the pads 2) for start the pads It does not kill the previous process of PADS .and both the process get hung. Please help me how I can solve this , that will work same in both from terminal and the java program Regards Khirod Patra |
Breaking it down
Take your problem and break it down into pieces:
Doing this can help you determine if it's a PADS issue, or inexperience with the Runtime.getRuntime().exec(...) method--which looks like a mix of the system and exec C calls--, or with your restart command. Divide and conquer, write small test cases, keep it simple. |
All times are GMT -5. The time now is 01:44 PM. |