[Bug 1036339] Re: zram-config runs even after uninstalled, needs purge

stuart naylor 1036339 at bugs.launchpad.net
Mon Mar 4 17:31:21 UTC 2019


#!/bin/sh
# preinst script for zram-config
#
# see: dh_installdeb(1)

set -e

# summary of how this script can be called:
#        * <new-preinst> `install'
#        * <new-preinst> `install' <old-version>
#        * <new-preinst> `upgrade' <old-version>
#        * <old-preinst> `abort-upgrade' <new-version>
# for details, see http://www.debian.org/doc/debian-policy/ or
# the debian-policy package


case "$1" in
    install|upgrade)
        if [ -z "$2" ]; then
            if [ -f /etc/init/zram.conf ]; then
                rm -f /etc/init/zram.conf
            fi
        fi
    ;;

    abort-upgrade)
    ;;

    *)
        echo "preinst called with unknown argument \`$1'" >&2
        exit 1
    ;;
esac

# dh_installdeb will replace this with shell code automatically
# generated by other debhelper scripts.

#DEBHELPER#

exit 0

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to zram-config in Ubuntu.
https://bugs.launchpad.net/bugs/1036339

Title:
  zram-config runs even after uninstalled, needs purge

Status in zram-config package in Ubuntu:
  Confirmed

Bug description:
  zram-config, even after uninstalled, leaves behind the /etc/init/zram-
  config.conf file, likely because it's marked as a conffile

  This file, being the only actual functional file in zram-config, and
  the only thing needed by Upstart to configure zram swaps, doesn't
  check whether the zram-config package is installed before merrily
  continuing as if zram-config were actually in the system.

  I suggest to move some of the /etc/init/zram-config.conf code into
  shell scripts that are tested for presence (or executability) before
  being run, exiting silently if they're not there.

  If they're absent, this means package is uninstalled and zram-config
  should exit silently.

  It'd be nice if, in the process, some configuration moved into
  /etc/default/zram-config, like the fraction of the ram that should be
  used for zram swap (in the line around "(1/2 of ram)" comment in
  "zram-config.conf").

  Steps to reproduce:

   $ sudo apt-get install zram-config
   $ cat /proc/swaps
    (see zram swap(s))
   $ sudo apt-get remove zram-config
   $ sudo reboot
   (wait for reboot and open terminal again)
   $ cat /proc/swaps
    (see zram swap(s) still there when they shouldn't)

  The workaround is to type

  dpkg --purge zram-config

  Which finally removes the upstart script and stops zram swaps from
  being configured at boot.

  ProblemType: Bug
  DistroRelease: Ubuntu 12.04
  Package: zram-config 0.1
  ProcVersionSignature: Ubuntu 3.2.0-29.46~ppa1-generic-tuxonice 3.2.24
  Uname: Linux 3.2.0-29-generic-tuxonice x86_64
  ApportVersion: 2.0.1-0ubuntu12
  Architecture: amd64
  Date: Mon Aug 13 20:06:46 2012
  Dependencies:
   
  InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release amd64 (20120425)
  PackageArchitecture: all
  ProcEnviron:
   LANGUAGE=pt_BR:pt:en
   TERM=xterm
   PATH=(custom, no user)
   LANG=pt_BR.UTF-8
   SHELL=/bin/bash
  SourcePackage: zram-config
  UpgradeStatus: No upgrade log present (probably fresh install)

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zram-config/+bug/1036339/+subscriptions



More information about the foundations-bugs mailing list