Checkservice is written to check the status of the services