[yum-cvs] yum-utils/updateonboot README, NONE, 1.1 yum-updateonboot.init, NONE, 1.1 yum-updateonboot.sysconfig, NONE, 1.1
Gijs Hollestelle
gijs at login.linux.duke.edu
Tue Mar 22 19:26:06 UTC 2005
Update of /home/groups/yum/cvs/yum-utils/updateonboot
In directory login:/tmp/cvs-serv7551/updateonboot
Added Files:
README yum-updateonboot.init yum-updateonboot.sysconfig
Log Message:
Adding initial versions of updateonboot and repoquery scripts
--- NEW FILE README ---
This script yum update on boot. This allows machines that have been turned
off for an extended amount of time to become secure immediately, instead of
waiting until the next early morning cron job.
To install this, copy yum-updateonboot.init to /etc/init.d/yum-updateonboot
and copy yum-updateonboot.sysconfig to /etc/sysconfig/yum-updateonboot
After copying the files, run: /sbin/chkconfig --add yum-updateonboot
There are a couple of configuration options in /etc/sysconfig/yum-updateonboot
REBOOT_RPMS - any rpms listed in this variable will have their version and
release numbers checked before and after the updates. If there
is any change in those numbers, or in the number of installed
packages with that name, the init script will immediately reboot
the system. This is intended to catch kernel updates and
immediately boot into the new kernel, instead of having to later
schedule a downtime to do it.
GROUPLIST - This is a list of groups that the init script will call
'yum groupupdate' on (its called after the 'yum update' and
before the last check of rpm versions for REBOOT_RPMS). This
way you will also install any updates to yum groups that you
may have in your local repositories.
--- NEW FILE yum-updateonboot.init ---
#! /bin/bash
#
# yum-updateonboot Updates rpms on the system at boot
#
# chkconfig: 2345 25 75
# description: Runs 'yum update' at boot. Also calls 'yum groupinstall' for \
# specified groups
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Library General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# Copyright 2005 Duke University
# Written by Sean Dilda <sean at duke.edu>
# Source function library.
. /etc/init.d/functions
if [ ! -f /etc/sysconfig/yum-updateonboot ]; then
exit 0
fi
. /etc/sysconfig/yum-updateonboot
# See how we were called.
case "$1" in
start)
if [ "x$REBOOT_RPMS" != "x" ] ;then
TMP1=`/bin/mktemp /tmp/yum-update.XXXXXX`
TMP2=`/bin/mktemp /tmp/yum-update.XXXXXX`
rpm -q $REBOOT_RPMS > $TMP1
fi
echo -n "Updating RPMS on system: "
yum -y update &> /dev/null && success || failure
echo
OLD_IFS=$IFS
IFS=";"
for group in $GROUPLIST ; do
IFS=$OLD_IFS
echo -n $"Updating RPMS in group $group: "
yum -y groupupdate "$group" &> /dev/null && success || failure
echo
done
IFS=$OLD_IFS
if [ "x$REBOOT_RPMS" != "x" ] ;then
rpm -q $REBOOT_RPMS > $TMP2
if ! diff $TMP1 $TMP2 &> /dev/null; then
rm -f $TMP1
rm -f $TMP2
echo "Critical RPMs were updated.. rebooting now"
/sbin/reboot
fi
rm -f $TMP1
rm -f $TMP2
fi
;;
stop)
;;
status)
;;
restart|reload)
cd "$CWD"
$0 stop
$0 start
;;
*)
echo $"Usage: $0 {start|stop|restart|reload|status}"
exit 1
esac
exit 0
--- NEW FILE yum-updateonboot.sysconfig ---
# IF any of these rpms are updated, the yum-updateonboot init script will
# reboot immediately after the yum update. To keep yum-updateonboot from
# rebooting the system, comment this line out.
#REBOOT_RPMS="kernel kernel-smp"
# A list of groups that should be updated at boot. For each group mentioned
# yum-updateonboot will call 'yum -y groupupdate' Since group names tend to
# have spaces in them, used a semi-colon to separate the group names
#GROUPLIST="My Group;MyOtherGroup;Some_Group;My Group 4"
More information about the Yum-cvs-commits
mailing list