Add `epmd` systemd service on systems that don't have it. Fixes #5

parent 1726701e
...@@ -2,6 +2,7 @@ DESTDIR:= ...@@ -2,6 +2,7 @@ DESTDIR:=
prefix:=$(DESTDIR)/opt prefix:=$(DESTDIR)/opt
REBAR3:=./rebar3 REBAR3:=./rebar3
SERVICE:=$(DESTDIR)/etc/systemd/system/mtproto-proxy.service SERVICE:=$(DESTDIR)/etc/systemd/system/mtproto-proxy.service
EPMD_SERVICE:=$(DESTDIR)/etc/systemd/system/epmd.service
LOGDIR:=$(DESTDIR)/var/log/mtproto-proxy LOGDIR:=$(DESTDIR)/var/log/mtproto-proxy
USER:=mtproto-proxy USER:=mtproto-proxy
...@@ -27,10 +28,15 @@ $(LOGDIR): ...@@ -27,10 +28,15 @@ $(LOGDIR):
install: user $(LOGDIR) install: user $(LOGDIR)
mkdir -p $(prefix)
cp -n -r _build/prod/rel/mtp_proxy $(prefix)/mtp_proxy/ cp -n -r _build/prod/rel/mtp_proxy $(prefix)/mtp_proxy/
mkdir -p $(prefix)/mtp_proxy/log/ mkdir -p $(prefix)/mtp_proxy/log/
chmod 777 $(prefix)/mtp_proxy/log/ chmod 777 $(prefix)/mtp_proxy/log/
install -D config/mtproto-proxy.service $(SERVICE) 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 systemctl daemon-reload
uninstall: uninstall:
......
[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
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment