linuxapachetomcatrootstart-stop-daemon

How to Start/Stop Tomcat for normal user except root in Linux CentOS


I just install Tomcat6 in my Linux CentOS and I just want user to Start/Stop Tomcat without permission denied, there only root have no permission to do so. Any solutions?

Thanks.


Solution

  • You can write a rule in visudo. Something like;

    Cmnd_Alias     CUSTOM_CMD = /opt/tomcat/bin/startup.sh, /opt/tomcat/bin/shutdown.sh
    
    myuser        ALL = (root) NOPASSWD:CUSTOM_CMD