I have Ubuntu in my machine where I have installed snmpd. To start stop I use below command:
Runtime.getRuntime.exe("service snmpd start")
Suddenly people started talking about a link instead of the question. The solution is easy. One need to wait for the process to complete. See below code.
Process process = Runtime.getRuntime().exec("service snmpd start"); process.waitFor();