java - How to stop the application from within in Openshift -


i want able stop application inside every 3 days. want schedule method automatically stop application without intervention outside (like sitting on desktop etc).

so far, have these in mind:

runtime.getruntime().exec("rhc stop-app --app applicationname"); //this doesn't work. have tried 

or

system.exit(0) // told not run command on openshift server 

or

runtime.getruntime().exit(0) //i afraid run command 

or

runtime.getruntime().halt(0) //i afraid run command       

some of commands afraid use because told not run them on openshift server may stop whole vm. , stop applications hosted on vm. , me banned. banned.

edit: question not how stop application generally. question regarding how stop spring mvc wep application hosted on openshift server. , no answers donot work in link.

well, used runtime.getruntime().exit(0) , stopped application. didn't ban or anything. , restarted application see if there issues. no issues. command do. thanks

edit: works openshift restarts application automatically. not answer. put answer here if find one. thanks


Comments

Popular posts from this blog

magento2 - Magento 2 admin grid add filter to collection -

Android volley - avoid multiple requests of the same kind to the server? -

Combining PHP Registration and Login into one class with multiple functions in one PHP file -