Best practice and approach on how to check if the service is started and start if it is not

Hello all,

I would like to automate the checking of the services if is it properly chkconfig on and set to on if its off and start. also need to check if the service is on then start if its off in RHEL6.

Thanks.

Hello,

Is there a specific importance to knowing this?
Ansible can be set to start a process if its not running and also add the chkconfig as needed.

# Example action to start service httpd, if not running
- service: name=httpd state=started enabled=yes
Should be enough to resolve it for you.