Hello, Chefs. I’m writing a cookbook to manage a certain security agent on Linux – to deploy the RPM, and enable and start the service. But I am having problems, and this is the first package/service I have worked with that does not seem to play well with Chef. Chef thinks the service is running when it’s not, and thinks it’s not running when it is.
I think the problem is that for this package, the RHEL7 command “service SERVICE_NAME status” returns 1 if the service is running, and 0 if the service is not running. I am under the impression that the Chef “service” resource will run that status command to check the status of the service so it doesn’t start or stop it unnecessarily. Is that true? If so, that would explain the Chef behavior I’m seeing.
Has any of you come across a service on Linux for which “service SERVICE_NAME status” returns 1 if the service is running, and 0 if the service is not running? Why might the vendor have built it (their init.d script for this package) that way?