SlapOS Home SlapOS

    How To Add a Monitored Service

    How to add a monitored service
    • Last Update:2022-04-06
    • Version:003
    • Language:en

    Agenda

    • Monitor Stack
    • Add Monitor Stack
    • Verification

    This HowTo describes how to add the monitor stack to your software release in the context of html5as-base software release.

    Here is the commit introducing this functionality to html5as software release: commit diff.

    Add Monitored Services

    • Monitored Services are run by supervisord.
    • Any executable placed in INSTANCE-ROOT/etc/service/ will automatically be considered a monitored service.
    • To add a monitored service to an instance, render its executable in INSTANCE-ROOT/etc/service/

    Services that are not running will be started automatically at the end of an instanciation.

    If a monitored Service exit, the signal will trigger an alert to the local SlapOS master forcing the reprocessing of the instance and all its dependecies in order to get back to an expected state. The -on-watch postfix is added to the service name in supervisord in order to mark this service as monitored.

    Monitor Web Service

    Change the executable launcher from ${basedirectory:script} to ${basedirectory:service}

    [html5as]
    ...
    # Executables
    bin_launcher = ${basedirectory:service}/launcher

    Update md5sum

    Refer How To Move to md5sum automatic update to update md5sum:

    $ cd ~/srv/project/slapos/software/html5as-base
    $ ../../update-hash

    Validation

    • Verify Launcher renamed

    Verify Launcher renamed

    The instance should be re-instantiated: 

    $ slapos node instance --all

    You can get the status of services run by supervisord via

    & slapos node status

    Launcher is now named to launcher-on-watch