home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2007 September / PCWSEP07.iso / Software / Linux / Linux Mint 3.0 Light / LinuxMint-3.0-Light.iso / casper / filesystem.squashfs / var / lib / dpkg / info / cron.postinst < prev    next >
Encoding:
Text File  |  2006-12-20  |  1.8 KB  |  73 lines

  1. #!/bin/sh
  2. set -e
  3.  
  4. update-rc.d cron multiuser 89 11 >/dev/null
  5.  
  6. # Remove shutdown and reboot links; this init script does not need them.
  7. if dpkg --compare-versions "$2" lt "3.0pl1-94ubuntu1"; then
  8.     rm -f /etc/rc0.d/K11cron /etc/rc6.d/K11cron
  9. fi
  10.  
  11. # Copy existing allow/deny files
  12. crondir="/var/spool/cron"
  13. pausemessage="F"
  14. for fname in allow deny ; do
  15.     if [ -f $crondir/$fname ] ; then
  16.     if [ ! -f $/etc/cron.$fname ] ; then
  17.         mv $crondir/$fname /etc/cron.$fname
  18.         echo " "
  19.         echo "Moving $crondir/$fname to /etc/cron.$fname to comply with Debian policy"
  20.         pausemessage="T"
  21.     else
  22.         echo " "
  23.         echo "Warning:"
  24.         echo "Both $crondir/$fname and /etc/cron.$fname exist -- cron will"
  25.         echo "use /etc/cron.$fname"
  26.         pausemessage="T"
  27.     fi
  28.     fi
  29. done
  30. #
  31. # Move dpkg status file backups, if necessary/possible.
  32. #
  33. ( cd /var/lib/dpkg ;
  34. for oldstat in status.yesterday.* ; do
  35.     if [ -f $oldstat ] ; then
  36.         newstat=`echo $oldstat | sed 's/yesterday\.//'`;
  37.         newstat=/var/backups/dpkg.$newstat;            
  38.         if [ ! -f $newstat ] ; then
  39.             mv $oldstat $newstat ;
  40.         fi
  41.     fi                        
  42. done)
  43.  
  44. # Add group for crontabs
  45. getent group crontab > /dev/null 2>&1 || addgroup --system crontab
  46.  
  47. # Fixup crontab binary, directory and files for new group 'crontab'.
  48.  
  49. if ! dpkg-statoverride --list /usr/bin/crontab > /dev/null ; then
  50.     chgrp crontab /usr/bin/crontab
  51.     chmod g+s /usr/bin/crontab
  52.     chgrp crontab $crondir/crontabs
  53.     chmod 1730 $crondir/crontabs
  54.     if dpkg --compare-versions "$2" lt "3.0pl1-81" ; then
  55.         cd $crondir/crontabs
  56.         set +e
  57.         ls -1 |  xargs -r -n 1 --replace=xxx  chown 'xxx:crontab' 'xxx'
  58.         set -e
  59.     fi
  60. fi
  61.  
  62. if [ -x /etc/init.d/cron ]; then
  63.     if [ -x /usr/sbin/invoke-rc.d ] ; then
  64.            invoke-rc.d cron start
  65.     else
  66.            /etc/init.d/cron start
  67.     fi
  68. fi
  69.  
  70.  
  71.  
  72.  
  73.