ETCDIR = $(DESTDIR)/etc
INITDIR = $(DESTDIR)/etc/init.d
+SRVDIR = $(DESTDIR)/usr/lib/systemd/system
MAN8DIR = $(DESTDIR)/usr/share/man/man8
SBINDIR = $(DESTDIR)/usr/sbin
VARLIBDIR = $(DESTDIR)/var/lib/overlay-boot
VARLIBFILES += overlay-share
INITFILES = subhosts
ETCFILES = subhosts.conf
+SRVFILES = subhost@.service
# The default is to build asm/reaper
REAPER = src/reaper
$(addprefix $(VARLIBDIR)/,$(VARLIBFILES)): $(VARLIBDIR)/%: % | $(VARLIBDIR)/
cp -p $< $@
+# Generic rule: copy service files
+$(addprefix $(SRVDIR)/,$(SRVFILES)): $(SRVDIR)/%: % | $(SRVDIR)/
+ cp $< $@
+
# Make target: to clean up this workspace
clean:
rm -f reaper *.8
INSTALLTARGETS += $(addprefix $(MAN8DIR)/,$(MAN8FILES))
INSTALLTARGETS += $(addprefix $(VARLIBDIR)/,$(VARLIBFILES))
INSTALLTARGETS += $(addprefix $(INITDIR)/,$(INITFILES))
+INSTALLTARGETS += $(addprefix $(SRVDIR)/,$(SRVFILES))
INSTALLTARGETS += $(addprefix $(ETCDIR)/,$(ETCFILES))
install: $(INSTALLTARGETS)
--- /dev/null
+[Unit]
+Description=Start overlay-boot subhost instance %i
+Documentation=man:overlay-boot(8)
+
+[Service]
+ExecStart=/usr/sbin/overlay-boot %i
+ExecStop=/usr/sbin/overlay-stop %i
+
+[Install]
+WantedBy=multi-user.target