openflighthpc / concertim-ansible-playbook

Ansible playbook for building a Concertim appliance
Eclipse Public License 2.0
0 stars 0 forks source link

Add emma, mia and phoenix-module systemd service files and monit scripts #25

Closed benarmston closed 1 year ago

benarmston commented 1 year ago

This PR adds support for controlling individual instances of emma, mia and the phoenix-modules without systemd "losing track" of them. This allows, for instance, monit to restart individual emma instances without the potential issues alluded to in #14.

For emma, this works by having a oneshot emma.service unit file, a emma@.service unit template file and an emma-generator script. The emma-generator script runs on boot, creating dynamic services such as emma@9900.service and configuring the emma.service to "want" them.

When the emma.service is started, stopped, etc, the individual instances emma@9900.service, emma@9901.service and emma@9902.service are also started, stopped, etc.. The emma@.service service template controls a single thin instance defined by the port name in the instance's name.

The result of this is that monit can restart individual emma instances, e.g., systemctl restart emma@9900.service, without breaking systemctl restart emma.service.

Similarly, there is a phoenix-mongrel.service service file, phoenix-mongrel@.service service template file and a phoenix-mongrel-generator generator script. The generator script creates instances such as phoenix-mongrel@mia.8000, phoenix-mongrel@mia.8001 and phoenix-mongrel@hacor.3002, etc..

For phoenix-mongrel@.service, the instance name, say, hacor.3002 is used to identify the PID file, e.g., /run/mongrel_cluster/hacor.3002.pid and some systemd/bash trickery to identify the config file, e.g., /etc/mongrel_cluster/hacor.yml.

With these changes all important services are now monitored by monit. Further work may be required to adjust the resource requirements for some or all of the services.

Fixes #14