Threaded messaging key: >> indicates my original post > indicates a reply NO > indicates my reply to the reply.
>>On Nov 5, 2013, at 6:36 PM, Jay Vee <jvsr...@gmail.com> wrote: >> I need to bounce tomcat (run a stop, startup script) but from a remote >> machine. >> >> SSH will not work. >> >> Tomcat runs as 'tomcat_user' and this user is not a ssh user so we cannot >> ssh into a box using this user. >> >> We have to ssh into the box with our exchange credentials and then $sudo su >> - tomcat _user >> to do the startup / shutdown. > >Why does this not work? Are you trying to automate the process in some way? Yes of course, we are trying to automate the deployment of a .war, bounce tomcat. This whole deployment pipeline thing just might catch on and we want to jump on the band wagon just in case it does. >If so, maybe look at configuring SSH & sudo. They are pretty flexible. For example, >you could enable key based authentication (i.e. password-less login) for your SSH user and >configure sudo to allow your user to run the startup / shutdown scripts without a password. > With that you could do a one command restart. This is a no go. I am not in the sys admin department. If I ask them to configure SSH & sudo they will freak no matter how rationale my argument is. We have access to the machines with out exchange/ldap login and then we sudo su to root. So this is why I posted the question. >> Is there any other way to programatially stop/start comcat? > >There's the shutdown port (or perhaps System.exit() called from an app), but that's just to >stop Tomcat. Once it's stopped you'd need to start it again somehow. I will look up the shutdown port. How would one programatically use the shutdown port to shut tomcat down? >The solution you're looking for here is going to be external to Tomcat. Yes this is expected. (bounce tomcat remote). I am running a script on another box and want to bounce tomcat with a script (ant/maven or something else) >Tomcat cannot restart >itself because once Tomcat's process exits, its code is no longer running. Thus there is >nothing to trigger it to start again. You need something outside of Tomcat like a script, >monitoring utility or service daemon to do a true restart. Yes, how would I do this? any other solutions? >Commons Daemon would be the first thing to check out since it's included with Tomcat, but >there are tons of other options. > > https://commons.apache.org/proper/commons-daemon/ Awesome, I will check that out. But with commons-daemon, I would think I still need ssh access as root to execute a script. > >Dan >> Ideally I would like to do this with gradle but there is no plugin so far: >> >> gradle tomcat plugin ( only works on a local tomcat, not a remote ) >> gradle cargo plugin ( does not have a task that will stop & restart tomcat) >> >> Unfortunately gradle is a bit lacking at the moment, ideally a single call >> to a gradle or ant task would be nice to bounce the server ( from a remote >> machine ). >> >> thanks >> >> >> J.V.