home *** CD-ROM | disk | FTP | other *** search
/ PC Welt 2006 November (DVD) / PCWELT_11_2006.ISO / casper / filesystem.squashfs / var / lib / dpkg / info / sysklogd.postinst < prev    next >
Encoding:
Text File  |  2006-07-29  |  1.6 KB  |  88 lines

  1. #! /bin/sh
  2.  
  3. set -e
  4.  
  5. if [ ! -d /var/log/news ] \
  6.     && grep -q /var/log/news/ /etc/syslog.conf \
  7.     && grep -q ^news: /etc/passwd \
  8.     && grep -q ^news: /etc/group 
  9. then
  10.     mkdir /var/log/news
  11.     chmod 2755 /var/log/news
  12.     chown news:news /var/log/news
  13. fi
  14.  
  15. if [ "$1" = "configure" ]
  16. then
  17.     case $2 in
  18.     1.2-*)
  19. cat<<EOT
  20. The default behaviour of syslogd has altered from 1.2 to 1.3.  By default
  21. *no* messages from the UDP port are accepted.
  22.  
  23. Read the documentation in /usr/share/doc/sysklogd carefully.  Some important
  24. things have been changed!
  25.  
  26. Press [Enter] to continue
  27. EOT
  28.     read xyz
  29.     ;;
  30.   esac
  31. fi
  32.  
  33. if [ "$1" = "configure" ]
  34. then
  35.     if [ -f /etc/init.d/sysklogd ]
  36.     then
  37.     set +e
  38.     if [ -x /usr/sbin/invoke-rc.d ]
  39.     then
  40.         invoke-rc.d sysklogd stop
  41.     else
  42.         sh /etc/init.d/sysklogd stop
  43.     fi
  44.     set -e
  45.     fi
  46.  
  47.     update-rc.d sysklogd multiuser 10 90 >/dev/null
  48.  
  49.     # Remove shutdown and reboot links; this init script does not need them.
  50.     if dpkg --compare-versions "$2" lt "1.4.1-18ubuntu2"; then
  51.     rm -f /etc/rc0.d/K90sysklogd /etc/rc6.d/K90sysklogd
  52.     fi
  53.  
  54.     adduser --system --group --no-create-home --quiet syslog
  55.  
  56.     # Create logfiles with correct file modes
  57.     #
  58.     for LOG in `syslogd-listfiles` `syslogd-listfiles --auth`
  59.     do
  60.     if [ ! -f $LOG ]; then
  61.         touch $LOG
  62.     fi
  63.     chown root:adm $LOG
  64.     chmod 640 $LOG
  65.     done
  66.  
  67.     # Tidying up some old stuff
  68.     #
  69.     rm -f /etc/rc?.d/[SK]*.syslogd
  70.  
  71.     # restarting daemon
  72.     #
  73.     if [ -f /etc/init.d/sysklogd ]
  74.     then
  75.     set +e
  76.     if [ -x /usr/sbin/invoke-rc.d ]
  77.     then
  78.         invoke-rc.d sysklogd start
  79.     else
  80.         sh /etc/init.d/sysklogd start
  81.     fi
  82.     set -e
  83.     fi
  84. fi
  85.  
  86.  
  87. exit 0
  88.