From 68c4659fdb89947a4bc54c993df8f3e115c52c29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=A1=D0=B5=D1=80=D0=B3=D0=B5=D0=B9=20=D0=9F=D1=80=D0=BE?= =?UTF-8?q?=D1=85=D0=BE=D1=80=D0=BE=D0=B2?= Date: Sat, 16 Feb 2019 17:00:54 +0100 Subject: [PATCH] Add `epmd` systemd service on systems that don't have it. Fixes #5 --- Makefile | 6 ++++++ config/epmd.service | 14 ++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 config/epmd.service diff --git a/Makefile b/Makefile index f406d71..76337a9 100644 --- a/Makefile +++ b/Makefile @@ -2,6 +2,7 @@ DESTDIR:= prefix:=$(DESTDIR)/opt REBAR3:=./rebar3 SERVICE:=$(DESTDIR)/etc/systemd/system/mtproto-proxy.service +EPMD_SERVICE:=$(DESTDIR)/etc/systemd/system/epmd.service LOGDIR:=$(DESTDIR)/var/log/mtproto-proxy USER:=mtproto-proxy @@ -27,10 +28,15 @@ $(LOGDIR): install: user $(LOGDIR) + mkdir -p $(prefix) cp -n -r _build/prod/rel/mtp_proxy $(prefix)/mtp_proxy/ mkdir -p $(prefix)/mtp_proxy/log/ chmod 777 $(prefix)/mtp_proxy/log/ install -D config/mtproto-proxy.service $(SERVICE) +# If there is no "epmd" service, install one + if [ -z "`systemctl show -p FragmentPath --value epmd`" ]; then \ + install -D config/epmd.service $(EPMD_SERVICE); \ + fi systemctl daemon-reload uninstall: diff --git a/config/epmd.service b/config/epmd.service new file mode 100644 index 0000000..7e31da0 --- /dev/null +++ b/config/epmd.service @@ -0,0 +1,14 @@ +[Unit] +Description=Erlang Port Mapper Daemon +After=network.target +#Requires=epmd.socket + +[Service] +ExecStart=/usr/bin/epmd +Type=simple +User=daemon +Group=daemon + +[Install] +#Also=epmd.socket +WantedBy=multi-user.target