[yum-commits] etc/Makefile etc/yum-cron.conf etc/yum-cron-hourly.conf yum-cron/Makefile yum-cron/yum-daily.cron.sh yum-cron/yum-hourly.cron.sh yum-cron/yum-update.cron.sh yum.spec

James Antill james at osuosl.org
Mon Apr 15 16:40:36 UTC 2013


 etc/Makefile                |    1 
 etc/yum-cron-hourly.conf    |   59 ++++++++++++++++++++++++++++++++++++++++++++
 etc/yum-cron.conf           |    2 -
 yum-cron/Makefile           |    6 ++--
 yum-cron/yum-daily.cron.sh  |   11 ++++++++
 yum-cron/yum-hourly.cron.sh |   11 ++++++++
 yum-cron/yum-update.cron.sh |   11 --------
 yum.spec                    |    4 ++
 8 files changed, 90 insertions(+), 15 deletions(-)

New commits:
commit 102c7527b7455dd7119b512ca5cdc296b3698554
Author: James Antill <james at and.org>
Date:   Mon Apr 15 12:38:32 2013 -0400

     Update yum-cron to make it worthwhile on Fedora.
    
     Add an hourly cron, to update the metadata.
    
     Download packages, by default, in the daily cron.

diff --git a/etc/Makefile b/etc/Makefile
index 99b5137..3e14af8 100644
--- a/etc/Makefile
+++ b/etc/Makefile
@@ -31,3 +31,4 @@ install:
 	install -m 644 yum.bash $(DESTDIR)/$(compdir)/yum
 	ln -s yum $(DESTDIR)/$(compdir)/yummain.py
 	install -m 644 yum-cron.conf $(YUMETC)
+	install -m 644 yum-cron-hourly.conf $(YUMETC)
diff --git a/etc/yum-cron-hourly.conf b/etc/yum-cron-hourly.conf
new file mode 100644
index 0000000..ece67c4
--- /dev/null
+++ b/etc/yum-cron-hourly.conf
@@ -0,0 +1,59 @@
+[commands]
+# Whether a message should emitted when updates are available.
+update_messages = no
+
+# Whether updates should be downloaded when they are available. Note
+# that updates_messages must also be yes for updates to be downloaded.
+download_updates = no
+
+# Whether updates should be applied when they are available.  Note
+# that both update_messages and download_updates must also be yes for
+# the update to be applied
+apply_updates = no
+
+# Maximum amout of time to randomly sleep, in minutes.  The program
+# will sleep for a random amount of time between 0 and random_sleep
+# minutes before running.  This is useful for e.g. staggering the
+# times that multiple systems will access update servers.  If
+# random_sleep is 0 or negative, the program will run immediately.
+random_sleep = 0
+
+
+[emitters]
+# Name to use for this system in messages that are emitted.  If
+# system_name is None, the hostname will be used.
+system_name = None
+
+# How to send messages.  Valid options are stdio and email.  If
+# emit_via includes stdio, messages will be sent to stdout; this is useful
+# to have cron send the messages.  If emit_via includes email, this
+# program will send email itself according to the configured options.
+# If emit_via is None or left blank, no messages will be sent.
+emit_via = stdio
+
+# The width, in characters, that messages that are emitted should be
+# formatted to.
+ouput_width = 80
+
+
+[email]
+# The address to send email messages from.
+email_from = root
+
+# List of addresses to send messages to.
+email_to = root
+
+# Name of the host to connect to to send email messages.
+email_host = localhost
+
+
+[groups]
+# List of groups to update
+group_list = None
+
+# The types of group packages to install
+group_package_types = mandatory, default
+
+[base]
+# override yum options of the same name
+# skip_broken = True
diff --git a/etc/yum-cron.conf b/etc/yum-cron.conf
index c227e40..d19fce3 100644
--- a/etc/yum-cron.conf
+++ b/etc/yum-cron.conf
@@ -4,7 +4,7 @@ update_messages = yes
 
 # Whether updates should be downloaded when they are available. Note
 # that updates_messages must also be yes for updates to be downloaded.
-download_updates = no
+download_updates = yes
 
 # Whether updates should be applied when they are available.  Note
 # that both update_messages and download_updates must also be yes for
diff --git a/yum-cron/Makefile b/yum-cron/Makefile
index 812bea2..875d3d7 100644
--- a/yum-cron/Makefile
+++ b/yum-cron/Makefile
@@ -17,10 +17,12 @@ install-sysv: install-common
 	install -D -m 755 yum-cron.sysvinit $(DESTDIR)/etc/rc.d/init.d/yum-cron
 
 install-common:
+	mkdir -p $(DESTDIR)/etc/cron.hourly
 	mkdir -p $(DESTDIR)/etc/cron.daily
 	mkdir -p $(DESTDIR)/etc/rc.d/init.d
 	mkdir -p $(DESTDIR)/usr/sbin
-# Install yum-update.cron as 0yum-update.cron so it runs before items like
+# Install as 0yum-*.cron so it runs before items like
 # manpage update, mlocate, and prelink
-	install -D -m 755 yum-update.cron.sh $(DESTDIR)/etc/cron.daily/0yum-update.cron
+	install -D -m 755 yum-daily.cron.sh $(DESTDIR)/etc/cron.daily/0yum-daily.cron
+	install -D -m 755 yum-hourly.cron.sh $(DESTDIR)/etc/cron.hourly/0yum-hourly.cron
 	install -D -m 755 yum-cron.py $(DESTDIR)/usr/sbin/yum-cron
diff --git a/yum-cron/yum-daily.cron.sh b/yum-cron/yum-daily.cron.sh
new file mode 100755
index 0000000..06dee5f
--- /dev/null
+++ b/yum-cron/yum-daily.cron.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Only run if this flag is set. The flag is created by the yum-cron init
+# script when the service is started -- this allows one to use chkconfig and
+# the standard "service stop|start" commands to enable or disable yum-cron.
+if [[ ! -f /var/lock/subsys/yum-cron ]]; then
+  exit 0
+fi
+
+# Action!
+exec /usr/sbin/yum-cron
diff --git a/yum-cron/yum-hourly.cron.sh b/yum-cron/yum-hourly.cron.sh
new file mode 100755
index 0000000..557dd4d
--- /dev/null
+++ b/yum-cron/yum-hourly.cron.sh
@@ -0,0 +1,11 @@
+#!/bin/bash
+
+# Only run if this flag is set. The flag is created by the yum-cron init
+# script when the service is started -- this allows one to use chkconfig and
+# the standard "service stop|start" commands to enable or disable yum-cron.
+if [[ ! -f /var/lock/subsys/yum-cron ]]; then
+  exit 0
+fi
+
+# Action!
+exec /usr/sbin/yum-cron -C /etc/yum/yum-cron-hourly.conf
diff --git a/yum-cron/yum-update.cron.sh b/yum-cron/yum-update.cron.sh
deleted file mode 100755
index 06dee5f..0000000
--- a/yum-cron/yum-update.cron.sh
+++ /dev/null
@@ -1,11 +0,0 @@
-#!/bin/bash
-
-# Only run if this flag is set. The flag is created by the yum-cron init
-# script when the service is started -- this allows one to use chkconfig and
-# the standard "service stop|start" commands to enable or disable yum-cron.
-if [[ ! -f /var/lock/subsys/yum-cron ]]; then
-  exit 0
-fi
-
-# Action!
-exec /usr/sbin/yum-cron
diff --git a/yum.spec b/yum.spec
index 08ff68e..a270de5 100644
--- a/yum.spec
+++ b/yum.spec
@@ -359,8 +359,10 @@ exit 0
 %files cron
 %defattr(-,root,root)
 %doc COPYING
-%{_sysconfdir}/cron.daily/0yum-update.cron
+%{_sysconfdir}/cron.daily/0yum-daily.cron
+%{_sysconfdir}/cron.hourly/0yum-hourly.cron
 %config(noreplace) %{_sysconfdir}/yum/yum-cron.conf
+%config(noreplace) %{_sysconfdir}/yum/yum-cron-hourly.conf
 %if %{yum_cron_systemd}
 %{_unitdir}/yum-cron.service
 %else


More information about the Yum-commits mailing list