unable to shut down the system after suspend / resume
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
systemd (Ubuntu) |
Won't Fix
|
Medium
|
Unassigned |
Bug Description
In the case of a system that has gone through a suspend / resume cycle, the "shutdown now" command fails with the following output:
$ shutdown now
Failed to power off system via logind: Transaction is destructive.
Failed to start poweroff.target: Interactive authentication required.
See system logs and 'systemctl status poweroff.target' for details.
Failed to open /dev/initctl: Permission denied
Failed to talk to init daemon.
---
$ systemctl status poweroff.target
● poweroff.target - Power-Off
Loaded: loaded (/lib/systemd/
Active: inactive (dead)
Docs: man:systemd.
---
$ systemctl list-jobs
JOB UNIT TYPE STATE
438 dev-mapper-
439 dev-mapper-
436 <email address hidden> start running
3 jobs listed.
---
Steps to reproduce:
1. Boot system
2. User login to graphical session
3. Close lid while on battery power triggering a suspend
4. Open lid while on battery power triggering a resume
5. Run "shutdown now" from a terminal. Note that the command must be run from the terminal to see output. Selecting "Shut Down..." from the system menu in the menu bar will hide the error output.
6. Observe that the system fails to shut down
Expected behavior:
At step 6, the system should shut down gracefully.
Note that the shutdown process works as expected if steps 3 and 4 are skipped. I suspect that something about the suspend / resume cycle during the session has an interaction effect with the shutdown process, preventing it from executing correctly.
ProblemType: Bug
DistroRelease: Ubuntu 16.04
Package: systemd 229-4ubuntu6
ProcVersionSign
Uname: Linux 4.4.0-24-generic x86_64
ApportVersion: 2.20.1-0ubuntu2.1
Architecture: amd64
CurrentDesktop: Unity
Date: Sat Jun 18 18:04:26 2016
EcryptfsInUse: Yes
Lsusb:
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 04f2:b550 Chicony Electronics Co., Ltd
Bus 001 Device 002: ID 8087:0a2a Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
MachineType: System76, Inc. Lemur
ProcEnviron:
LANGUAGE=en_US
PATH=(custom, no user)
XDG_RUNTIME_
LANG=en_US.UTF-8
SHELL=/bin/bash
ProcKernelCmdLine: BOOT_IMAGE=
SourcePackage: systemd
UpgradeStatus: No upgrade log present (probably fresh install)
dmi.bios.date: 11/29/2015
dmi.bios.vendor: American Megatrends Inc.
dmi.bios.version: 1.05.06RS76
dmi.board.
dmi.board.name: Lemur
dmi.board.vendor: System76, Inc.
dmi.board.version: lemu6
dmi.chassis.
dmi.chassis.type: 10
dmi.chassis.vendor: System76, Inc.
dmi.chassis.
dmi.modalias: dmi:bvnAmerican
dmi.product.name: Lemur
dmi.product.
dmi.sys.vendor: System76, Inc.
Changed in systemd (Ubuntu): | |
importance: | Undecided → Medium |
Changed in systemd (Ubuntu): | |
status: | Confirmed → Won't Fix |
I confirmed that disabling encrypted swap is a work-around for the inability to shut down. I commented out the cryptswap1 entry from /etc/crypttab:
$ diff /etc/crypttab /etc/crypttab~ 9969-4cf6- bb7e-482a50b41f fa /dev/urandom swap,offset= 1024,cipher= aes-xts- plain64 9969-4cf6- bb7e-482a50b41f fa /dev/urandom swap,offset= 1024,cipher= aes-xts- plain64
1c1
< # cryptswap1 UUID=d1bd47b1-
---
> cryptswap1 UUID=d1bd47b1-
I also set /etc/fstab to use the swap partition directly rather than /dev/mapper/ cryptswap1:
$ diff /etc/fstab /etc/fstab~ 9969-4cf6- bb7e-482a50b41f fa none swap sw 0 0 cryptswap1 none swap sw 0 0 9969-4cf6- bb7e-482a50b41f fa none swap sw 0 0 cryptswap1 none swap sw 0 0
16,17c16,17
< UUID=d1bd47b1-
< #/dev/mapper/
---
> #UUID=d1bd47b1-
> /dev/mapper/
On this machine, it seems encrypted swap was not working anyway as per lines in the attached JournalErrors.txt:
Jun 18 17:56:14 username-Lemur systemd- cryptsetup[ 446]: Failed to activate with key file '/dev/urandom': Device or resource busy cryptsetup[ 446]: Loading of cryptographic parameters failed: Invalid argument cryptsetup[ 446]: Failed to activate: Invalid argument cryptswap1. device. cryptswap1. cryptsetup[ 805]: Failed to activate with key file '/dev/urandom': Device or resource busy
...
Jun 18 17:56:18 username-Lemur systemd-
Jun 18 17:56:18 username-Lemur systemd-
Jun 18 17:56:18 username-Lemur systemd[1]: Failed to start Cryptography Setup for cryptswap1.
Jun 18 17:56:18 username-Lemur systemd[1]: Dependency failed for Encrypted Volumes.
Jun 18 17:56:18 username-Lemur systemd[1]: Dependency failed for dev-mapper-
Jun 18 17:56:18 username-Lemur systemd[1]: Dependency failed for /dev/mapper/
Jun 18 17:56:18 username-Lemur systemd[1]: Dependency failed for Swap.
Jun 18 17:56:18 username-Lemur systemd[1]: <email address hidden>: Failed with result 'exit-code'.
Jun 18 17:56:18 username-Lemur systemd-
With encrypted swap disabled as per the changes to /etc/crypttab and /etc/fstab, the machine now shuts down as expected even when suspend/resume cycles occur during the user session.