Comment 18 for bug 401056

Revision history for this message
Niall Creech (sevenmachines-deactivatedaccount) wrote :

how about,

#! /bin/sh

set -e

if [ "$1" = "purge" ]
then
    ( userdel syslog
  ERR="$?"
  if [ "$ERR" -eq "8" ] ; then
   echo "Ignoring removal of logged in user syslog"
   exit 0
  else
   exit $ERR
  fi
 ) || false
 update-rc.d sysklogd remove >/dev/null
fi

Need to use userdel to catch only error 8, deluser only gives 0 or 1.
Note, this problem will also happen if purging rsyslog when sysklogd is running