'How to create a service on linux Centos 6

How to create service on centos 6 to kill service and run script

For example :

If i run this command service test start

it should make the below

pkill test
nohup ./opt/test/test/bin/standalone.sh -c standalone-full.xml

Also if i run this command service test stop

it should make the below

pkill test



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source