java - Restart Unix service -


i have ubuntu in machine have installed snmpd. start stop use below command:

  1. service snmpd start
  2. service snmpd stop

now have execute comments java. have tried not work.

runtime.getruntime.exe("service snmpd start") 

so, tell me how execute service of linux suse through java?

any great

suddenly people started talking link instead of question. solution easy. 1 need wait process complete. see below code.

process process = runtime.getruntime().exec("service snmpd start"); process.waitfor(); 

Comments

Popular posts from this blog

Change php variable from jquery value using ajax (same page) -

Pull out data related to my apps from Android Play Store and iOS App Store -

How can I fetch data from a web server in an android application? -