2010-12-11 14:43:24 +01:00
|
|
|
class apt::reboot_required_notify {
|
|
|
|
|
|
|
|
# This package installs the script that created /var/run/reboot-required*.
|
|
|
|
# This script (/usr/share/update-notifier/notify-reboot-required) is
|
|
|
|
# triggered e.g. by kernel packages.
|
2013-01-02 14:12:11 +01:00
|
|
|
package { 'update-notifier-common':
|
2010-12-11 14:43:24 +01:00
|
|
|
ensure => installed,
|
|
|
|
}
|
|
|
|
|
|
|
|
# cron-apt defaults to run every night at 4 o'clock
|
2010-12-13 10:08:47 +01:00
|
|
|
# plus some random time <1h.
|
2010-12-11 14:43:24 +01:00
|
|
|
# so we check if a reboot is required a bit later.
|
|
|
|
cron { 'apt_reboot_required_notify':
|
|
|
|
command => 'if [ -f /var/run/reboot-required ]; then echo "Reboot required\n" ; cat /var/run/reboot-required.pkgs ; fi',
|
|
|
|
user => root,
|
2010-12-13 10:08:47 +01:00
|
|
|
hour => 5,
|
2010-12-11 14:43:24 +01:00
|
|
|
minute => 20,
|
|
|
|
require => Package['update-notifier-common'],
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|