Cannot install snaps on Ubuntu 14.04 with /var on its own partition
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
snapd |
Invalid
|
Undecided
|
Rafael David Tinoco | ||
systemd (Ubuntu) |
Invalid
|
Medium
|
Rafael David Tinoco | ||
Trusty |
Fix Released
|
Medium
|
Rafael David Tinoco |
Bug Description
[Impact]
Installing snaps is not possible on Ubuntu 14.04 when having /var on its own partition, whether its LVM or not.
The issue is with the core snap being unable to mount:
The error with /var isolated and using LVM:
root@ubuntu:~# snap install canonical-livepatch
error: cannot perform the following tasks:
- Mount snap "core" (2898) ([start snap-core-
)
The error with /var isolated but without using LVM:
root@ubuntu:~# snap install canonical-livepatch
error: cannot perform the following tasks:
- Mount snap "core" (2898) ([start snap-core-
)
The same error happens if I try to install the hello-world snap (with LVM in this example):
root@ubuntu:~# snap install hello-world
error: cannot perform the following tasks:
- Mount snap "core" (2898) ([start snap-core-
)
I cannot reproduce the issue in Ubuntu 16.04.
I couldn't reproduce this issue by using the Ubuntu 14.04 cloud image which doesn't isolate /var on its own partition. I tried adding a secondary disk to that cloud image VM and create a dummy VG and LV, but couldn't reproduce the issue.
Also could not reproduce using Ubuntu 14.04 (with LVM or not) but with only a / partition and swap.
[Test Case]
# Install Ubuntu 14.04 in KVM (I used the 14.04.4 server iso) and configure /, /var and swap on their own partitions (with LVM or not, the issue happens in both situations).
root@ubuntu:~# lvs
LV VG Attr LSize Pool Origin Data% Move Log Copy% Convert
rootvol vg00 -wi-ao--- 3.72g
swap vg00 -wi-ao--- 3.72g
varvol vg00 -wi-ao--- 3.72g
root@ubuntu:~# df -h
Filesystem Size Used Avail Use% Mounted on
udev 484M 4.0K 484M 1% /dev
tmpfs 100M 988K 99M 1% /run
/dev/dm-0 3.7G 1.7G 1.8G 49% /
none 4.0K 0 4.0K 0% /sys/fs/cgroup
none 5.0M 0 5.0M 0% /run/lock
none 497M 0 497M 0% /run/shm
none 100M 0 100M 0% /run/user
/dev/mapper/
# Upgrade system, install snapd and reboot
root@ubuntu:~# apt update
root@ubuntu:~# apt upgrade -y
root@ubuntu:~# apt install -y snapd
root@ubuntu:~# reboot
# After reboot, check kernel version and try to install the canonical-livepatch snap:
root@ubuntu:~# uname -a
Linux ubuntu 4.4.0-96-generic #119~14.04.1-Ubuntu SMP Wed Sep 13 08:40:48 UTC 2017 x86_64 x86_64 x86_64 GNU/Linux
root@ubuntu:~# snap list
No snaps are installed yet. Try "snap install hello-world".
root@ubuntu:~# snap install canonical-livepatch
error: cannot perform the following tasks:
- Mount snap "core" (2898) ([start snap-core-
)
[Regression Potential]
- Unit file has been added to systemd, could cause an error in some units initialization. Since systemd is not used as "init" system for Trusty, this is minor regression.
- Could break all systemd units depending (After=/Wants=) systemd-
** A "pre-SRU" test package provided in Tinoco's PPA has been also intensively tested with success, which bring even more confidence for this change. Note that the same level/quality of testing will be performed one more time when the package will be found in trusty-proposed. **
* Manual autopkgtest againts the systemd .dsc file :
adt-run [12:31:42]: @@@@@@@
timedated PASS
hostnamed PASS
localed-locale PASS
localed-x11-keymap PASS
logind PASS
api PASS
* About the autopkgtest regressions found :
https:/
[Other Info]
[Original Description]
Installing snaps is not possible on Ubuntu 14.04 when having /var on its own partition, whether its LVM or not.
Changed in systemd (Ubuntu Trusty): | |
assignee: | nobody → Rafael David Tinoco (inaddy) |
description: | updated |
Changed in systemd (Ubuntu Trusty): | |
importance: | Undecided → Medium |
description: | updated |
description: | updated |
description: | updated |
tags: | removed: patch |
Additional information:
root@ubuntu:~# systemctl status systemd- fsck@dev- mapper- vg00\x2dvarvol. service
<email address hidden>
Loaded: error (Reason: No such file or directory)
Active: inactive (dead)
root@ubuntu:~# systemctl status systemd- fsck@dev- mapper- vg00\varvol. service
<email address hidden>
Loaded: error (Reason: No such file or directory)
Active: inactive (dead)
root@ubuntu:~# systemctl status --all | grep fsck
root@ubuntu:~#
Trusty doesn't have the full implementation of systemd like xenial has.
xenial:
$ ls -l /lib/systemd/ system/ systemd- fsck* system/ systemd- fsckd.service system/ systemd- fsckd.socket system/ systemd- fsck-root. service system/ systemd- fsck@.service
-rw-r--r-- 1 root root 551 Jul 18 19:56 /lib/systemd/
-rw-r--r-- 1 root root 540 Jul 18 19:56 /lib/systemd/
-rw-r--r-- 1 root root 674 Jul 18 19:56 /lib/systemd/
-rw-r--r-- 1 root root 648 Jul 18 19:56 /lib/systemd/
trusty:
# ls -l /lib/systemd/ system/ systemd- fsck* system/ systemd- fsck*: No such file or directory
ls: cannot access /lib/systemd/
The system tries to call the fsck check but fails because the method or file doesn't exist:
Mount snap "core" (2898) ([start snap-core- 2898.mount] failed with exit status 6: Failed to issue method call: Unit systemd- fsck@dev- mapper- vg00\x2dvarvol. service failed to load: No such file or directory.
On a xenial system, that file would be this: ======= ======= ===== system/ systemd- fsck@.service
=======
$ cat /lib/systemd/
# This file is part of systemd.
#
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit] man:systemd- fsck@.service( 8) cies=no fsckd.socket fsck-root. service local-fs-pre.target systemd- fsckd.socket shutdown. target
Description=File System Check on %f
Documentation=
DefaultDependen
BindsTo=%i.device
Wants=systemd-
After=%i.device systemd-
Before=
[Service] /lib/systemd/ systemd- fsck %f ======= ======= =====
Type=oneshot
RemainAfterExit=yes
ExecStart=
TimeoutSec=0
=======
And the systemctl services and units would be there on xenial: ======= ======= ===== fsck-root. service - File System Check on Root Device fsck@dev- disk-by\ x2duuid- 0f1a47d4\ x2d67c5\ x2d4c18\ x2d9159\ x2dfd1d4409f30d .service - File System Check on /dev/disk/ by-uuid/ 0f1a47d4- 67c5-4c18- 9159-fd1d4409f3 0d fsck@dev- disk-by\ x2duuid- D233\x2dB0AC. service - File System Check on /dev/disk/ by-uuid/ D233-B0AC fsckd.service - File System Check Daemon to report status systemd\ x2dfsck. slice fsckd.socket - fsck to fsckd communication Socket ======= ======= =====
=======
$ systemctl status --all | grep fsck | grep ^●
● systemd-
● systemd-
● systemd-
● systemd-
● system-
● systemd-
=======
But not on Trusty:
root@trustysnap:~# systemctl status --all | grep fsck
root@trustysnap:~#
I don't see any relevant logs in /var/log.