-
Notifications
You must be signed in to change notification settings - Fork 30
Make startup scripts and service files more friendly to modern process supervision #111
Comments
FYI, most of the script is migrated to Erlang on the rabbitmq-server-script-replacement branch. |
Considerations to take into account:
|
"Not all of our supported operating systems use systemd" - other process supervisors in containers can lose sight of epmd. Can it be started without the -daemon argument? (Systemd actually manages to capture it due to cgroups - at least on EL7 it manages to clean up epmd/beam.smp and the erl children inet_gethost processes). I remember that in the EL6 days |
@space88man let's keep this issue a little bit more focused. Given that RabbitMQ supports a variety of platforms that do not use |
Moved to the packaging repo as it currently seems to fit best here. |
rabbitmq-epmd.service:
rabbitmq-server.service:
rabbitmq.target:
|
@space88man If you have a specific problem, or issue you have seen due to how RabbitMQ currently starts, that would be useful information for us. |
@space88man sorry but we would not consider a change unless we understand it. Why should we adopt those unit files? What are the risks? |
TL;DR: to work nicely with process supervisors (supervisord/s6 etc) don't launch @michaelklishin @lukebakken - This issue is intended to address process supervisors like supervisord, s6 which will be unable to manage epmd, given the way it is currently launched. I'd like to clarify that the current rabbitmq:
Process supervisor problem with /usr/sbin/rabbitmq-server Supervisor: https://github.com/just-containers/s6-overlay. A service in s6 is just an executable supervised by a monitoring process Configure a service
Observations:
Problem: epmd survives as it was reparented to PID 1 by Simplest solution Two service solution
Notice epmd is contained under
Of course for this to work properly s6 (and any other process supervisor/service management) would have to be using service dependency and declare that the rabbitmq service depends on the epmd service. In my previous post, I used systemd as it was easiest to demonstrate the dependency relationship |
@michaelklishin For RPM/systemd based systems, let me try to show the intention of the two service proposal.
When user tries to start rabbitmq-server, it will work(!) as rabbitmq-epmd is declared as an explicit dependency.
Actually, this would work anyway as Erlang has the autostart epmd capability — I am just being explicit here.
This makes me think of a separate question: do people ever run multiple instances of rabbitmq with a single instance of epmd? Then this suggestion might work well in that case.
|
Thanks for the explanations.
Only in development environments. @michaelklishin @dumbbell this seems like a |
From a systemd point of view, @space88man is right: epmd(1) should be managed separately because it requires privileges, can run from a user account, and open TCP ports which are different from and unrelated to RabbitMQ. RabbitMQ's mission was never to manage epmd(1). We relied on the way Erlang works for a long time: the first Erlang node to start with or enable distribution implicitely starts epmd(1) if it's missing. Therefore that instance of epmd(1) inherits the user & environment of that Erlang node. If we take a host running both RabbitMQ and Ejabberd as an example, depending on the first service to start, epmd(1) will run under different conditions. Anyway, as said above, RabbitMQ shouldn't do anything with epmd(1) management IMHO, this is out of scope. However, our Erlang RPM package can probably do something if that's the package in question. For instance, the Erlang Debian package installs the following
Would it help to do the same in our Erlang RPM package? |
The rabbitmq-server launch script runs multiple downstream scripts to start epmd and beam as long-running processes. This goes against modern process supervision that want epmd in the foreground and have beam and epmd as two separate services.
epmd -daemon enables epmd to escape process supervision suites that do not capture /usr/sbin/rabbitmq-server in a cgroup.
Observations:
Barely manages to tame epmd -daemon, but only because of cgroups.
Suggestions:
Willl something like
ExecStart=/usr/lib64/erlang/erts-10.5.3/bin/beam.smp -W w -A 64 ... just work?
However I am not sure where all the -MHas -MBas etc parameters come from.
The text was updated successfully, but these errors were encountered: