mirror of
https://git.proxmox.com/git/pve-manager
synced 2025-08-13 13:51:10 +00:00
improve pveupdate with random start time
this is important to avoid that all PVE nodes start the update procedure at the same time
This commit is contained in:
parent
8002175e60
commit
c93559150b
@ -17,6 +17,7 @@ SCRIPTS = \
|
|||||||
pveversion \
|
pveversion \
|
||||||
pvemailforward.pl \
|
pvemailforward.pl \
|
||||||
pveupgrade \
|
pveupgrade \
|
||||||
|
pveupdate \
|
||||||
pveperf
|
pveperf
|
||||||
|
|
||||||
SERVICE_MANS = $(addsuffix .8, ${SERVICES})
|
SERVICE_MANS = $(addsuffix .8, ${SERVICES})
|
||||||
|
@ -1,6 +0,0 @@
|
|||||||
SUBDIRS = daily
|
|
||||||
|
|
||||||
all: ${SUBDIRS}
|
|
||||||
|
|
||||||
%:
|
|
||||||
set -e && for i in ${SUBDIRS}; do ${MAKE} -C $$i $@; done
|
|
@ -1,15 +0,0 @@
|
|||||||
include ../../../defines.mk
|
|
||||||
|
|
||||||
all:
|
|
||||||
|
|
||||||
.PHONY: install
|
|
||||||
install: pve
|
|
||||||
install -d ${CRONDAILYDIR}
|
|
||||||
install -m 0755 pve ${CRONDAILYDIR}
|
|
||||||
|
|
||||||
.PHONY: distclean
|
|
||||||
distclean: clean
|
|
||||||
|
|
||||||
.PHONY: clean
|
|
||||||
clean:
|
|
||||||
rm -rf *~
|
|
@ -25,7 +25,7 @@ my $rpcenv = PVE::RPCEnvironment->init('cli');
|
|||||||
|
|
||||||
$rpcenv->init_request();
|
$rpcenv->init_request();
|
||||||
$rpcenv->set_language($ENV{LANG});
|
$rpcenv->set_language($ENV{LANG});
|
||||||
$rpcenv->set_user('root@pam');
|
$rpcenv->set_user('root@pam');
|
||||||
|
|
||||||
my $nodename = PVE::INotify::nodename();
|
my $nodename = PVE::INotify::nodename();
|
||||||
|
|
1
debian/conffiles
vendored
1
debian/conffiles
vendored
@ -3,7 +3,6 @@
|
|||||||
/etc/init.d/pveproxy
|
/etc/init.d/pveproxy
|
||||||
/etc/init.d/spiceproxy
|
/etc/init.d/spiceproxy
|
||||||
/etc/init.d/pvestatd
|
/etc/init.d/pvestatd
|
||||||
/etc/cron.daily/pve
|
|
||||||
/etc/vz/vznet.conf
|
/etc/vz/vznet.conf
|
||||||
/etc/vzdump.conf
|
/etc/vzdump.conf
|
||||||
/etc/logrotate.d/pve
|
/etc/logrotate.d/pve
|
||||||
|
15
debian/postinst
vendored
15
debian/postinst
vendored
@ -43,6 +43,21 @@ case "$1" in
|
|||||||
# remove old APL dir
|
# remove old APL dir
|
||||||
rm -rf /var/lib/pve-manager/apl-available
|
rm -rf /var/lib/pve-manager/apl-available
|
||||||
|
|
||||||
|
# remove old cron.daily update job to randomize it
|
||||||
|
if test -e /etc/cron.daily/pve; then
|
||||||
|
echo "Remove old update script from cron.daily"
|
||||||
|
rm /etc/cron.daily/pve
|
||||||
|
fi
|
||||||
|
|
||||||
|
# create new daily randomize update cronjob if not exist
|
||||||
|
if !(test -e /etc/cron.d/pveupdate); then
|
||||||
|
MIN="$(shuf -i 0-59 -n 1)"
|
||||||
|
|
||||||
|
HOUR="$(shuf -i 6-10 -n 1)"
|
||||||
|
echo "Create cron job for daily update"
|
||||||
|
printf " ${MIN} ${HOUR} * * * root /usr/bin/pveupdate\n\n" > /etc/cron.d/pveupdate
|
||||||
|
fi
|
||||||
|
|
||||||
if test ! -e /var/lib/pve-manager/apl-info/download.proxmox.com; then
|
if test ! -e /var/lib/pve-manager/apl-info/download.proxmox.com; then
|
||||||
mkdir -p /var/lib/pve-manager/apl-info
|
mkdir -p /var/lib/pve-manager/apl-info
|
||||||
cp /usr/share/doc/pve-manager/aplinfo.dat /var/lib/pve-manager/apl-info/download.proxmox.com
|
cp /usr/share/doc/pve-manager/aplinfo.dat /var/lib/pve-manager/apl-info/download.proxmox.com
|
||||||
|
Loading…
Reference in New Issue
Block a user