mono-xsp2.postinst fails if /var/run/mono-xsp2 doesn't exist when the package is configured.

Bug #294773 reported by David Yoffe on 2008-11-06
80
This bug affects 11 people
Affects Status Importance Assigned to Milestone
xsp (Ubuntu)
Low
Unassigned

Bug Description

package mono-xsp2 1.9.1-2 failed to install/upgrade: subprocess post-installation script returned error exit status 1

The package fails to configure is /var/run/mono-xsp2 doesn't exist

== TEST CASE ==
With /var/run mounted as tmpfs run the following commands:
$ apt-get install --download-only mono-xsp2
$ dpkg --unpack /var/cache/apt/archives/mono-xsp2*
- Restart your computer
$ apt-get -f install

The following command in mono-xps2.postinst is failing because we do not check if the directory exists before executing chown
78 # chmod the working directories
79 chown -R www-data:www-data /var/run/mono-xsp2

ProblemType: Package
Architecture: i386
DistroRelease: Ubuntu 8.10
ErrorMessage: subprocess post-installation script returned error exit status 1
Package: mono-xsp2 1.9.1-2
PackageArchitecture: all
SourcePackage: xsp
Title: package mono-xsp2 1.9.1-2 failed to install/upgrade: subprocess post-installation script returned error exit status 1
Uname: Linux 2.6.27-7-generic i686

David Yoffe (yoffedavid) wrote :
Jean-Baptiste Lallement (jibel) wrote :

Thanks for your report. The creation of the directory /var/run/mono-xsp2 should be handled in the postinst script to avoid failure when unpack and configure are separate by a reboot and /var/run is of type tmpfs.

Thanks for your help to make Ubuntu better

Changed in xsp:
importance: Undecided → Low
status: New → Triaged

Unable to reproduce on recent releases, quite possibly a transient issue or fixed by recent packaging changes

Changed in xsp (Ubuntu):
status: Triaged → Invalid
Jean-Baptiste Lallement (jibel) wrote :

This is still an issue but I agree that's a corner case.

To reproduce:
$ apt-get install --download-only mono-xsp2
$ dpkg --unpack /var/cache/apt/archives/mono-xsp2*
- Restart your computer
$ apt-get -f install

The creation should be handled by the init.d script, according to the Debian Policy 9.3.2: "/var/run and /var/lock may be mounted as temporary filesystems[66], so the init.d scripts must handle this correctly. This will typically amount to creating any required subdirectories dynamically when the init.d script is run, rather than including them in the package and relying on dpkg to create them."

Changed in xsp (Ubuntu):
status: Invalid → Triaged
importance: Low → Medium
summary: - package mono-xsp2 1.9.1-2 failed to install/upgrade: /var/run/mono-xsp2
- doesn't exists
+ /var/run/mono-xsp2 should be created in init.d script

I'm confused - it's already created in the init script - line 39 - and that file hasn't changed for *years*

Jean-Baptiste Lallement (jibel) wrote :

Sorry, you're right. The problem is not with the init script but with the chown of the working directory in mono-xsp2.postint. I think that the chown can simply be removed because it's created and chowned in the init script (I don't know if mono-xsp2-update needs that directory.)

Changed in xsp (Ubuntu):
importance: Medium → Low
summary: - /var/run/mono-xsp2 should be created in init.d script
+ mono-xsp2.postinst fails if /var/run/mono-xsp2 doesn't exist when the
+ package is configured.
description: updated
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers