On Thu, Jul 26, 2012 at 1:09 PM, Peter Lemenkov <lemen...@gmail.com> wrote:
> Hello All.
> I'm trying to write a systemd service for epmd (Erlang Port Mapper
> Daemon, if someone is curious). its only purpose is to open a TCP port
> 4369 at 0.0.0.0 and act as a simple messaging (very simple actually)
> bus between erlang nodes. I'd like to run it w/o anything and under a
> most restricted system account. So far I'm using this service:


    (Notice: Slightly off topic for systemd, but very on topic for EPMD...)

    Please be aware that starting `epmd` under a service monitoring
system like systemd (or others) is not 100% possible under the current
circumstances. For a detailed explanation please see the following
thread on the Erlang mailing list:
      http://erlang.org/pipermail/erlang-questions/2011-October/061802.html

    The summary is that if someone starts an Erlang application before
your `epmd` instance starts you'll end up with your `epmd` dieing and
being restarted by systemd in a continuous loop, because each Erlang
application tries to start its own `epmd` instance. (Thus there is a
race condition here.) In the thread above I've found a workaround for
this issue but it's not quite "documented"...

    On the other hand if you would modify `epmd` to use socket
activation at least the issue will be less likely to happen. (It can
still happen if someone starts the Erlang application even before
systemd.)

    Hope it helps,
    Ciprian.
_______________________________________________
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel

Reply via email to