From 59a2aec9c8fb2dfbcfe80668571c39cc08af770c Mon Sep 17 00:00:00 2001 From: "Austin S. Hemmelgarn" Date: Tue, 15 Sep 2020 07:40:05 -0400 Subject: Added support for using `/etc/cron.d` for auto-updates. (#9598) * Add crontab fragment for netdata updater. This adds a crontab fragment to be put in `/etc/cron.d` on system swhich do not support either `/etc/cron.daily` or `/etc/periodic/daily`, allowing for proper auto-updater support on such systems. The crontab will run upates at 02:57, which was chosen arbitrarily because it does not conflict with th erun times for any major distribution's daily scheduled tasks. * Utilize the crontab fragment for updates on systems that need it. This adds logic to utilize the crontab fragment added by the previous commit on systems which need it for auto-updates to work. The installer will preferentially use `/etc/cron.daily` or `/etc/periodic/daily` instead if they exist, so this should result in no changes for most users. * Remove systemd scheduler detection. We're not actually using it right now, and it breaks handling of auto-updates on systemd systems. --- system/Makefile.am | 3 +++ system/netdata.crontab.in | 1 + 2 files changed, 4 insertions(+) create mode 100644 system/netdata.crontab.in (limited to 'system') diff --git a/system/Makefile.am b/system/Makefile.am index babad46990..6b9e8f7f7e 100644 --- a/system/Makefile.am +++ b/system/Makefile.am @@ -12,6 +12,7 @@ CLEANFILES = \ netdata-lsb \ netdata-freebsd \ netdata.plist \ + netdata.crontab \ $(NULL) include $(top_srcdir)/build/subst.inc @@ -34,6 +35,7 @@ nodist_noinst_DATA = \ netdata-lsb \ netdata-freebsd \ netdata.plist \ + netdata.crontab \ $(NULL) dist_noinst_DATA = \ @@ -47,4 +49,5 @@ dist_noinst_DATA = \ netdata-freebsd.in \ netdata.plist.in \ netdata.conf \ + netdata.crontab.in \ $(NULL) diff --git a/system/netdata.crontab.in b/system/netdata.crontab.in new file mode 100644 index 0000000000..8f0527e0e0 --- /dev/null +++ b/system/netdata.crontab.in @@ -0,0 +1 @@ +2 57 * * * root @pkglibexecdir_POST@/netdata-updater.sh -- cgit v1.2.3