Package: hibernate
Severity: important
Tags: patch

hibernate tries to create /usr/local/share/hibernate/scriptlets.d via
postinst but allows for failure by using ...

    "mkdir -p /usr/local/share/hibernate/scriptlets.d || true"

... to create the directory hirearchy.  During uninstall, it also
removes non-empty directories in /usr/local but fails during prerm if
the directory could not be created (if /usr/local is mounted readonly).
The error in prerm should be ignored even if the error is because of
non-empty directories.

In my case, /usr/local is a set of 'network wide' utils that is mounted
read-only over nfs.

Failure transcript and patch follow:

Transcript:
===========

[loktak debian]$ sudo apt-get install hibernate
Reading package lists... Done
Building dependency tree... Done
Suggested packages:
  kernel-patch-suspend2
Recommended packages:
  vlock hdparm
The following NEW packages will be installed
  hibernate
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 0B/68.5kB of archives.
After unpacking 336kB of additional disk space will be used.
Selecting previously deselected package hibernate.
(Reading database ... 72654 files and directories currently installed.)
Unpacking hibernate (from .../hibernate_1.12-1_all.deb) ...
Setting up hibernate (1.12-1) ...
mkdir: cannot create directory `/usr/local/share/hibernate': Read-only file 
system

[loktak debian]$ 
[loktak debian]$ 
[loktak debian]$ sudo apt-get remove --purge hibernate
Reading package lists... Done
Building dependency tree... Done
The following packages will be REMOVED
  hibernate*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Need to get 0B of archives.
After unpacking 336kB disk space will be freed.
Do you want to continue [Y/n]?
(Reading database ... 72699 files and directories currently installed.)
Removing hibernate ...
rmdir: `/usr/local/share/hibernate/scriptlets.d': No such file or directory
rmdir: `/usr/local/share/hibernate': No such file or directory
dpkg: error processing hibernate (--purge):
 subprocess pre-removal script returned error exit status 1
mkdir: cannot create directory `/usr/local/share/hibernate': Read-only file 
system
Errors were encountered while processing:
 hibernate
E: Sub-process /usr/bin/dpkg returned an error code (1)

Patch:
=====

--- hibernate.prerm.orig        2006-04-03 19:09:21.729979000 +0530
+++ hibernate.prerm     2006-04-03 19:20:27.359528000 +0530
@@ -1,7 +1,8 @@
 #! /bin/sh
 # Pre-removal hook script for hibernate

-rmdir --ignore-fail-on-non-empty /usr/local/share/hibernate/scriptlets.d
-rmdir --ignore-fail-on-non-empty /usr/local/share/hibernate
+rmdir /usr/local/share/hibernate/scriptlets.d || true
+rmdir /usr/local/share/hibernate || true
+rmdir /usr/local/share || true

Giridhar

--
Y Giridhar Appaji Nag | http://www.appaji.net/

-- System Information:
Debian Release: testing/unstable
  APT prefers testing
  APT policy: (900, 'testing'), (800, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.15-1-686
Locale: LANG=en_IN, LC_CTYPE=en_IN (charmap=UTF-8)


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to