pve-manager/bin/Makefile
Thomas Lamprecht ca0fc07dd4 fix #844: allow to pre-delay start-all-marked guests on boot
Add a simple ExecStartPre command which reads the local node config,
and if a delay is set the helper sleeps that long then exists.

The systemd-unit approach was chosen as this ensures that we really
only delay when doing the startall on node boot. The pve-guests
service does not allows manual stops, starts or restarts, it can only
be pulled in by the multi-user.target

Mark this command with "-" to tell systemd that errors of it should
not cause an abort, it's a best-effort approach.

The journal from a 2 second delay would look like:
> Nov 19 13:13:48 dev6 systemd[1]: Starting PVE guests...
> Nov 19 13:13:48 dev6 pve-startall-delay[2318]: Delaying on-boot 'startall' command for 2 second(s).
> ...
> Nov 19 13:13:50 dev6 pve-guests[2339]: <root@pam> starting task UPID:dev6:00000924:00000529:5DD3DC7E:startall::root@pam:

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
2019-11-20 20:20:58 +01:00

88 lines
2.5 KiB
Makefile

include ../defines.mk
# this requires package pve-doc-generator
export NOVIEW=1
PERL_DOC_INC_DIRS=..
include /usr/share/pve-doc-generator/pve-doc-generator.mk
SERVICES = pvestatd pveproxy pvedaemon spiceproxy
CLITOOLS = vzdump pvesubscription pveceph pveam pvesr pvenode pvesh pve5to6
SCRIPTS = \
${SERVICES} \
${CLITOOLS} \
pvebanner \
pveversion \
pvemailforward.pl \
pveupgrade \
pveupdate \
pveperf \
pvereport
SERVICE_MANS = $(addsuffix .8, ${SERVICES})
CLI_MANS = \
$(addsuffix .1, ${CLITOOLS}) \
pveversion.1 \
pveupgrade.1 \
pveperf.1 \
pvereport.1 \
BASH_COMPLETIONS = \
$(addsuffix .service-bash-completion, ${SERVICES}) \
$(addsuffix .bash-completion, ${CLITOOLS}) \
ZSH_COMPLETIONS = \
$(addsuffix .service-zsh-completion, ${SERVICES}) \
$(addsuffix .zsh-completion, ${CLITOOLS}) \
all: ${SERVICE_MANS} ${CLI_MANS} pvemailforward
%.1: %.1.pod
rm -f $@
cat $<|pod2man -n $* -s 1 -r ${VERSION} -c"Proxmox Documentation" - >$@.tmp
mv $@.tmp $@
%.1.pod:
podselect $* > $@.tmp
mv $@.tmp $@
pve5to6.1:
echo ".TH pve5to6 1" > $@
pveversion.1.pod: pveversion
pveupgrade.1.pod: pveupgrade
pvereport.1.pod: pvereport
pvemailforward: pvemailforward.c
$(CC) $(CPPFLAGS) $(CFLAGS) -Wall -g -O2 $< -o $@
.PHONY: check
check: $(addsuffix .service-api-verified, ${SERVICES}) $(addsuffix .api-verified, ${CLITOOLS})
rm -f *.service-api-verified *.api-verified
.PHONY: install
install: ${SCRIPTS} ${CLI_MANS} ${SERVICE_MANS} pvemailforward ${BASH_COMPLETIONS} ${ZSH_COMPLETIONS}
install -d ${BINDIR}
install -m 0755 ${SCRIPTS} ${BINDIR}
install -d ${USRSHARE}/helpers
install -m 0755 pve-startall-delay ${USRSHARE}/helpers
install -s -m 2755 -g www-data pvemailforward ${BINDIR}
install -d ${MAN1DIR}
install -m 0644 ${CLI_MANS} ${MAN1DIR}
install -d ${MAN8DIR}
install -m 0644 ${SERVICE_MANS} ${MAN8DIR}
for i in ${CLITOOLS}; do install -m 0644 -D $$i.bash-completion ${BASHCOMPLDIR}/$$i; done
for i in ${SERVICES}; do install -m 0644 -D $$i.service-bash-completion ${BASHCOMPLDIR}/$$i; done
for i in ${CLITOOLS}; do install -m 0644 -D $$i.zsh-completion ${ZSHCOMPLDIR}/_$$i; done
for i in ${SERVICES}; do install -m 0644 -D $$i.service-zsh-completion ${ZSHCOMPLDIR}/_$$i; done
.PHONY: clean
clean:
make cleanup-docgen
rm -rf *~ *.tmp ${CLI_MANS} ${SERVICE_MANS} *.1.pod *.8.pod pvemailforward \
*.bash-completion *.service-bash-completion \
*.zsh-completion *.service-zsh-completion \
*.api-verified *.service-api-verified