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

This commit is contained in:
Сергей Прохоров 2019-02-16 17:00:54 +01:00
parent 1726701e2d
commit 68c4659fdb
No known key found for this signature in database
GPG key ID: 1C570244E4EF3337
2 changed files with 20 additions and 0 deletions

View file

@ -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:

14
config/epmd.service Normal file
View file

@ -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