Keep the Yawcam Windows Service running 24/7 with Service Protector

How to Keep the Yawcam Windows Service Running 24/7 with Service Protector

Automatically restart Yawcam if it stops for any reason. Achieve 100% uptime for your webcam software, even if it fails.

Yawcam is a free webcam software package implemented in java. You can install it as a windows service, to start automatically when your server boots:

Yawcam installed as a Windows Service

To monitor the Yawcam windows service and have Service Protector automatically restart it if it stops for any reason:

  1. Download and install Service Protector, if necessary.

  2. Start Service Protector.

  3. Select Protector > Add to open the Add Protector window:

    Add Protector

  4. On the General tab, in the Service to protect field, choose the Yawcam windows service. You will notice a green circle to the left of the entry if the service is already running, as was the case on our server.

    Yawcam Windows Service: General Tab

  5. If you find that the HTTP service occasionally fails, switch to the Monitor tab where we will set up a failure detection script to tell Service Protector when Yawcam is not serving pages.

    1. Follow these instructions to create the failure detection BAT file, making sure to edit the batch file to specify the HTTP port (usually 8888). We have called our batch file check-yawcam.bat and placed it in our Yawcam installation folder (C:\Program Files (x86)\Yawcam).

    2. Click the "..." button in the Whenever it fails a "sanity check" section and specify the full path to the batch file.

      Adjust the Every setting to a value that you can live with. The default of 30 seconds seems too frequent for us so we have specified 10 minutes instead.

    Apache Windows Service: Monitor Tab

  6. We are now done configuring Yawcam so click the Save button to record your settings. In a few seconds, an entry for Yawcam will show up in the Service Protector window. Service Protector is not yet monitoring it though, and you will see the "Not protected" value in the State column:

    Yawcam Windows Service: Created

    If Yawcam is running, you can click on the green circle in the "Service State" column to pop up a tooltip showing a few details of the service:

    Yawcam Windows Service: Information Tooltip

  7. To start monitoring Yawcam, choose Protector > Start "Yawcam". The shield icon will become green to indicate that the Yawcam windows service is being managed:

    Yawcam Windows Service: Protected

    Click on the shield icon to find out about protection:

    Yawcam Windows Service: Protected Tooltip

  8. That's it! Next time your computer boots, the Yawcam windows service will start as normal and Service Protector will begin monitoring it to quickly restart it if it stops for any reason.

    And now that you have gone through the basics, please feel free to edit Yawcam in Service Protector and check out the many other settings that may help your webcam software to operate smoothly. For example, send an email when the service fails, check for the service using too much RAM, and much more.

Trouble protecting the Yawcam Windows Service?