title: Setting up JSP page to restart CentOS
body: <p>I am trying to create a jsp page under tomcat webserver to restart CentOS7 server. It is able to write a text file but unable to invoke restart/shutdown command. Is it due to permission issue?</p>
  
  <pre><code>&lt;%
    Runtime runtime = Runtime.getRuntime();
    Process proc = runtime.exec("reboot");
    out.println("restart");
  
  %&gt;
  </code></pre>
  
  <p>Any help will be appreciated. Thank you</p>