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