I like to stop Tomcat before redeployment, manually clean out the old wars and all the logs, then restart the server. To do that from Jenkins, I have been using the SSH plugin and call sudo service tomcat stop/start and it works... sometimes. Other times the stop works but it fails to restart but the job still erroneously succeeds.
Is there an alternative to restarting Tomcat to SSH, especially when invoked from Jenkins. E.g. can I set up something like xinetd to make these admin functins somewhat of web services. Automating SSH connection from Jenkins is sort of a crapchute.