Skip to content

Commit dafe2ec

Browse files
authored
Enable aziot-edged in CentOS package (#5094)
Enables aziot-edged during postinstall so that it starts automatically.
1 parent ce0ca9a commit dafe2ec

File tree

3 files changed

+12
-2
lines changed

3 files changed

+12
-2
lines changed

edgelet/Makefile

+6-1
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ man1=$(mandir)/man1
3333
man8=$(mandir)/man8
3434
srcdir?=.
3535
unitdir?=/lib/systemd/system
36+
presetdir?=/usr/lib/systemd/system-preset
3637

3738
rpmbuilddir?=$(HOME)/rpmbuild
3839
vendordir?=vendor
@@ -134,6 +135,7 @@ deb: release
134135
cd $(TARGET)/$(PACKAGE) && dpkg-buildpackage $(DPKGFLAGS)
135136

136137
rpm:
138+
cp $(srcdir)/contrib/centos/00-aziot-edged.preset $(rpmbuilddir)/SOURCES
137139
$(SED) "s/@version@/${RPM_VERSION}/g; s/@release@/${RPM_RELEASE}/g;" $(srcdir)/contrib/centos/aziot-edge.spec > $(rpmbuilddir)/SPECS/aziot-edge.spec
138140
rpmbuild $(RPMBUILDFLAGS) $(rpmbuilddir)/SPECS/aziot-edge.spec
139141

@@ -190,6 +192,9 @@ install: release
190192
$(GZIP) $(DESTDIR)$(docdir)/LICENSE
191193
$(GZIP) $(DESTDIR)$(docdir)/ThirdPartyNotices
192194

195+
install-rpm: install
196+
$(INSTALL_DATA) -D $(rpmbuilddir)/SOURCES/00-aziot-edged.preset $(DESTDIR)$(presetdir)/00-aziot-edged.preset
197+
193198
uninstall:
194199
rm -f $(DESTDIR)$(bindir)/aziot-edged
195200
rm -f $(DESTDIR)$(bindir)/iotedge
@@ -211,4 +216,4 @@ version:
211216
@echo "rpm version: ${RPM_VERSION}"
212217
@echo "rpm release: ${RPM_RELEASE}"
213218

214-
.PHONY: all clean deb dist install rpm rpm-dist uninstall version
219+
.PHONY: all clean deb dist install install-rpm rpm rpm-dist uninstall version
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Enable aziot-edged to start automatically.
2+
3+
enable aziot-edged.service

edgelet/contrib/centos/aziot-edge.spec

+3-1
Original file line numberDiff line numberDiff line change
@@ -51,8 +51,9 @@ make \
5151
LISTEN_WORKLOAD_URI=unix://%{iotedge_socketdir}/workload.sock \
5252
DESTDIR=$RPM_BUILD_ROOT \
5353
unitdir=%{_unitdir} \
54+
presetdir=%{_presetdir} \
5455
docdir=%{_docdir}/%{name} \
55-
install
56+
install-rpm
5657

5758
%clean
5859
rm -rf $RPM_BUILD_ROOT
@@ -163,6 +164,7 @@ fi
163164

164165
# systemd
165166
%{_unitdir}/aziot-edged.service
167+
%{_presetdir}/00-aziot-edged.preset
166168

167169
# sockets
168170
%attr(660, %{iotedge_user}, %{iotedge_group}) %{iotedge_socketdir}/mgmt.sock

0 commit comments

Comments
 (0)