reboot_required_notify.pp 709 B

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