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.
This PR adds support for controlling individual instances of
emma
,mia
and thephoenix-modules
without systemd "losing track" of them. This allows, for instance,monit
to restart individualemma
instances without the potential issues alluded to in #14.For
emma
, this works by having a oneshotemma.service
unit file, aemma@.service
unit template file and anemma-generator
script. Theemma-generator
script runs on boot, creating dynamic services such asemma@9900.service
and configuring theemma.service
to "want" them.When the
emma.service
is started, stopped, etc, the individual instancesemma@9900.service
,emma@9901.service
andemma@9902.service
are also started, stopped, etc.. Theemma@.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 individualemma
instances, e.g.,systemctl restart emma@9900.service
, without breakingsystemctl restart emma.service
.Similarly, there is a
phoenix-mongrel.service
service file,phoenix-mongrel@.service
service template file and aphoenix-mongrel-generator
generator script. The generator script creates instances such asphoenix-mongrel@mia.8000
,phoenix-mongrel@mia.8001
andphoenix-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