mirror of
https://github.com/seriyps/mtproto_proxy.git
synced 2026-05-13 08:46:46 +00:00
Add epmd systemd service on systems that don't have it. Fixes #5
This commit is contained in:
parent
1726701e2d
commit
68c4659fdb
2 changed files with 20 additions and 0 deletions
6
Makefile
6
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:
|
||||
|
|
|
|||
14
config/epmd.service
Normal file
14
config/epmd.service
Normal 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
|
||||
Loading…
Add table
Add a link
Reference in a new issue