I need some help creating a script to restart a service in Centos7. The service 'RADARCH2' runs a java process (JBOSS) and I see it in grep as
root 13897 10.7 6.5 26496152 8705024 ? Sl Dec18 130:36 java -Dprogram.name=run.sh -server -Xms512m -Xmx4g -XX:MaxPermSize=1g -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000 -Djboss.messaging.ServerPeerID=0 -Djavax.xml.transform.TransformerFactory=com.sun.org.apache.xalan.internal.xsltc.trax.TransformerFactoryImpl -Djava.awt.headless=true -Dapp.name=dcm4chee -Djava.net.preferIPv4Stack=true -Djava.library.path=/opt/dcm4chee-2.18.0-mysql/bin/native -Djava.endorsed.dirs=/opt/dcm4chee-2.18.0-mysql/lib/endorsed -classpath /opt/dcm4chee-2.18.0-mysql/bin/run.jar org.jboss.Main -b 0.0.0.0 -c default
Right now, on system startup, the service starts up on its own. I can successfully stop/restart the service with:
'systemctl stop radarch2' or 'systemctl start radarch2'. The three options only available are 'stop|start|status', so there is no 'restart' option.
On occasion the service will stop with no warning, and nothing in its log to show why or what made it stop at all. Its frustrating, so I think I need to go this route.
After this script is created, what would be the best way to run it? Just create a service for it?