error during upgrade: cannot create /dev/shm: file exists

Bug #1389891 reported by Martin-Éric Racine
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
sysvinit (Ubuntu)
Fix Released
High
Martin Pitt

Bug Description

Setting up initscripts (2.88dsf-53.2ubuntu1) ...
mkdir: cannot create directory '/dev/shm': File exists
dpkg: error processing package initscripts (--configure):
 subprocess installed post-installation script returned error exit status 1

Perhaps missing the -p option to exit without error if the directory already exists?

ProblemType: Bug
DistroRelease: Ubuntu 15.04
Package: initscripts 2.88dsf-53.2ubuntu1
Uname: Linux 3.16-3-686-pae i686
ApportVersion: 2.14.7-0ubuntu8
Architecture: i386
Date: Thu Nov 6 00:28:02 2014
ProcEnviron:
 SHELL=/bin/bash
 TERM=xterm
 PATH=(custom, user)
 LANG=fi_FI.UTF-8
 LANGUAGE=fi:en
SourcePackage: sysvinit
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Martin-Éric Racine (q-funk) wrote :
Revision history for this message
Martin-Éric Racine (q-funk) wrote :

$ LC_ALL=C ls -al /dev/shm
lrwxrwxrwx 1 root root 8 Jul 22 2012 /dev/shm -> /run/shm

Revision history for this message
Martin-Éric Racine (q-funk) wrote :

Actually, even adding --parents to mkdir in postinst doesn't fix it, since we're dealing with a symbolic link. Suggestions?

Steve Langasek (vorlon)
Changed in sysvinit (Ubuntu):
assignee: nobody → Martin Pitt (pitti)
Revision history for this message
Martin Pitt (pitti) wrote :

The check does [ -d /dev/shm ], i. e. that means that you don't have a /run/shm? Can you please tell me what kind of environment that is? Perhaps a schroot or pbuilder or so with a totally empty /run that doesn't start any init script?

I think I know how to fix that, but confirming the nature where this failure happens would still be interesting. Thanks!

Revision history for this message
Martin Pitt (pitti) wrote :

Also, was this an upgrade from 14.10, or a fresh install?

Changed in sysvinit (Ubuntu):
importance: Undecided → High
status: New → Incomplete
Revision history for this message
Martin-Éric Racine (q-funk) wrote :

This is my ubuntu+1 chroot, upgraded from release to release for the past 7 years or so.

Yes, it appears that /run/shm has gone missing. That would explain everything.

As a matter of curiosity, which ones of /run/shm or /dev/shm is the current default standard? I'm wondering whether there might have been changes of strategy upstream, as to which one of those two is expected to exist, that could have left me with a dangling symbolic link.

Revision history for this message
Martin Pitt (pitti) wrote :

> which ones of /run/shm or /dev/shm is the current default standard?

That's a bit undefined. The upstream glibc standard is /dev/shm/; Debian introduced /run/shm/ a while ago essentially because "it looks nicer" (https://wiki.debian.org/ReleaseGoals/RunDirectory), which led to all this confusion and complicated postinst code to move directories and symlinks back and forth :-(

So in essence, we either need /dev/shm -> /run/shm/, or /run/shm -> /dev/shm/.

Revision history for this message
Martin-Éric Racine (q-funk) wrote :

CADT has spread to Debian and lead to FHS-deviant release goals. That definitely explains the confusion.

Anyhow, since the target is is the Ubuntu chroot, I "solved" this by re-creating /dev/shm, removing /run/shm and calling it a day.

I'll leave it to you decide whether enforcing something similar in postinst would make sense for Ubuntu or not. :)

Revision history for this message
Martin Pitt (pitti) wrote :

Indeed /dev/shm/ shouldn't be a symlink at all; at least not if /run/shm is a symlink or doesn't exist. I get a slightly different, but still similar problem here as well with my schroots.

Changed in sysvinit (Ubuntu):
status: Incomplete → In Progress
Martin Pitt (pitti)
Changed in sysvinit (Ubuntu):
status: In Progress → Fix Committed
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package sysvinit - 2.88dsf-53.2ubuntu2

---------------
sysvinit (2.88dsf-53.2ubuntu2) vivid; urgency=medium

  * debian/sysvinit-utils.maintscript: Clean up obsolete
    /etc/init/startpar-bridge.conf conffile on upgrades. (LP: #1390726)
  * debian/initscripts.postinst: In chroots without any bind mounts one often
    ends up with a /dev/shm → /run/shm → /dev/shm circular symlink. Break this
    and re-create /run/shm/ as a proper directory (note that the canonical
    location is in /dev, but https://wiki.debian.org/ReleaseGoals/RunDirectory
    is still the official policy). (LP: #1389891)
 -- Martin Pitt <email address hidden> Tue, 11 Nov 2014 09:07:40 +0100

Changed in sysvinit (Ubuntu):
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.