build: rpm and deb use the same systemd service file

This commit is contained in:
William Yang 2021-12-02 14:43:24 +01:00
parent 0f796c886a
commit bf72b9f297
4 changed files with 4 additions and 2 deletions

View File

@ -13,6 +13,7 @@ TARGET_PKG := $(EMQX_NAME)-$(PKG_VSN)-otp$(OTP_VSN)-$(SYSTEM)-$(ARCH)
.PHONY: all
all: | $(BUILT)
cp -r debian $(SRCDIR)/
cp emqx.service $(SRCDIR)/debian/${EMQX_NAME}.service
sed -i "s#<DATETIME>#$(shell date -u '+%a, %d %b %Y %T %z')#g" $(SRCDIR)/debian/changelog
sed -i "s#<VERSION>#$(PKG_VSN)#g" $(SRCDIR)/debian/changelog
sed -i "s/emqx-pkg/$(EMQX_NAME)-pkg/g" $(SRCDIR)/debian/rules; \

View File

@ -0,0 +1 @@
../emqx.service

View File

@ -7,9 +7,9 @@ User=emqx
Group=emqx
Type=forking
Environment=HOME=/var/lib/emqx
ExecStart=/bin/sh /usr/bin/emqx start
ExecStart=/usr/bin/emqx start
LimitNOFILE=1048576
ExecStop=/bin/sh /usr/bin/emqx stop
ExecStop=/usr/bin/emqx stop
Restart=on-failure
RestartSec=5s