"Failed to get unit file state for run-vmblockx2dfuse.mount: No such file or directory" during open-vm-tools-desktop postinstall in Ubuntu 16.10

Bug #1639222 reported by 林博仁(Buo-ren, Lin)
This bug report is a duplicate of:  Bug #1513531: Error while installing. Edit Remove
18
This bug affects 3 people
Affects Status Importance Assigned to Milestone
open-vm-tools (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

The following error messages appear during postinst of open-vm-tools-desktop in Ubuntu 16.10:

```
Created symlink /etc/systemd/system/multi-user.target.wants/run-vmblock\x2dfuse.mount → /lib/systemd/system/run-vmblock\x2dfuse.mount.
Failed to get unit file state for run-vmblockx2dfuse.mount: No such file or directory
run-vmblock\x2dfuse.mount is a disabled or a static unit, not starting it.
```

According to the postinst script:

```
# Automatically added by dh_systemd_enable
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask run-vmblock\\x2dfuse.mount >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled run-vmblock\\x2dfuse.mount; then
        # Enables the unit on first installation, creates new
        # symlinks on upgrades if the unit file has changed.
        deb-systemd-helper enable run-vmblock\\x2dfuse.mount >/dev/null || true
else
        # Update the statefile to add new symlinks (if any), which need to be
        # cleaned up on purge. Also remove old symlinks.
        deb-systemd-helper update-state run-vmblock\\x2dfuse.mount >/dev/null || true
fi
```

It seems that the deb-systemd-helper script unable to properly process filepaths containing a slash. View the problem in a different angle it is suspicious for /etc/systemd/system/multi-user.target.wants/run-vmblock\x2dfuse.mount file to have a slash in a filename in the first place, which looks like a escape character for hyphen-minus(0x2d), isn't the file should be named run-vmblock-fuse.mount instead?

ProblemType: Bug
DistroRelease: Ubuntu 16.10
Package: open-vm-tools-desktop 2:10.0.7-3227872-5ubuntu1
ProcVersionSignature: Ubuntu 4.8.0-26.28-generic 4.8.0
Uname: Linux 4.8.0-26-generic x86_64
ApportVersion: 2.20.3-0ubuntu8
Architecture: amd64
CurrentDesktop: Unity
Date: Fri Nov 4 20:15:14 2016
SourcePackage: open-vm-tools
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
林博仁(Buo-ren, Lin) (buo-ren-lin) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in open-vm-tools (Ubuntu):
status: New → Confirmed
Revision history for this message
Oliver Kurth (okurth-1) wrote :

Is there an update on this bug? We are hiting this issue frequently when testing open-vm-tools-desktop (version 2:10.1.10-2) with Ubuntu 17.10.

The root cause for this issue is escaping. run-vmblock\x2dfuse.mount is used in multiple places in the prerm, postrm and postinst scripts, and in most cases insufficiently escaped. Two backslashes are needed:

vmware@vmware-virtual-machine:~$ cat test.sh
#!/bin/sh

echo systemctl start run-vmblockx2dfuse.mount
systemctl start run-vmblockx2dfuse.mount

echo systemctl start run-vmblock\x2dfuse.mount
systemctl start run-vmblock\x2dfuse.mount

echo systemctl start run-vmblock\\x2dfuse.mount
systemctl start run-vmblock\\x2dfuse.mount

vmware@vmware-virtual-machine:~$ sudo ./test.sh
systemctl start run-vmblockx2dfuse.mount
Failed to start run-vmblockx2dfuse.mount: Unit run-vmblockx2dfuse.mount not found.
systemctl start run-vmblockx2dfuse.mount
Failed to start run-vmblockx2dfuse.mount: Unit run-vmblockx2dfuse.mount not found.
systemctl start run-vmblock\x2dfuse.mount
vmware@vmware-virtual-machine:~$

To elaborate on the previous comment why there is \x2d in the filename - this is a requirement for systemd. The mount point is /run/vmblock-fuse (with a plain '-'), but dashes in the mount file name will be converted to '/'. Hence we need to protect the dash by escaping it.

I am confused by the postinst script snippet copied in the bug description - it's not what I have - note that thee are only single backslashes:

#!/bin/sh
set -e

# load the fuse module just in case its missing
if ! lsmod | grep -qE '^fuse\s+'; then
    modprobe fuse || true
fi

# Automatically added by dh_systemd_enable/10.7.2ubuntu2
# This will only remove masks created by d-s-h on package removal.
deb-systemd-helper unmask run-vmblock\x2dfuse.mount >/dev/null || true

# was-enabled defaults to true, so new installations run enable.
if deb-systemd-helper --quiet was-enabled run-vmblock\x2dfuse.mount; then
        # Enables the unit on first installation, creates new
        # symlinks on upgrades if the unit file has changed.
        deb-systemd-helper enable run-vmblock\x2dfuse.mount >/dev/null || true
else
        # Update the statefile to add new symlinks (if any), which need to be
        # cleaned up on purge. Also remove old symlinks.
        deb-systemd-helper update-state run-vmblock\x2dfuse.mount >/dev/null || true
fi
# End automatically added section
# Automatically added by dh_installinit/10.7.2ubuntu2
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ]; then
        # In case this system is running systemd, we need to ensure that all
        # necessary tmpfiles (if any) are created before starting.
        if [ -d /run/systemd/system ] ; then
                systemd-tmpfiles --create /usr/lib/tmpfiles.d/open-vm-tools-desktop.conf >/dev/null || true
        fi
fi
# End automatically added section
# Automatically added by dh_systemd_start/10.7.2ubuntu2
if [ -d /run/systemd/system ]; then
        systemctl --system daemon-reload >/dev/null || true
        deb-systemd-invoke start run-vmblock\x2dfuse.mount >/dev/null || true
fi
# End automatically added section

Revision history for this message
vmware-gos-Yuhua (yhzou) wrote :

No update for a long time. Does anybody pay attention to this issue ?

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.