#848044 systemd: Stretch+Luks system encryption + LVM = delayed shutdown - A stop job is waiting for..

Package:
systemd
Source:
systemd
Description:
system and service manager
Submitter:
"Irek S."
Date:
2019-12-12 18:30:03 UTC
Severity:
normal
#848044#5
Date:
2016-12-13 14:40:21 UTC
From:
To:
Dear Maintainer,

I have upgraded from Jessie (fresh install) to Stretch.
During system shutdown on my screen I recieve series of messages - i.e:
[....*...] (9 of 13) A stop job is running for /dev/dm-2 (n sec of 1min 30 sec)
[....*...] (10 of 13) A stop job is running for /dev/disk/by-id/dm-name-
sdb1_crypt (n sec of 1min 30 sec)
[....*...] (12 of 13) A stop job is running for /dev/disk/by-id/dm-uuid....  (n
sec of 1min 30 sec)
[....*...] (13 of 13) A stop job is running for Session c2 of user Debian-gdm
(n sec of 1min 30 sec)
and shutdown is delayed 90 secs.

My setup
System is installed on 2 disks using LUKS encryption and LVM setup. See details
below:
--
cat /etc/crypttab
sda5_crypt UUID=ca3b4860-0671-4690-b771-72cbdd6e9bc6 none luks
sdb1_crypt UUID=68af85c4-4214-43be-baa6-62b264814067 none luks

cat /etc/fstab
# <file system> <mount point>   <type>  <options>       <dump>  <pass>
/dev/mapper/vol1sys-LVroot /               ext4    errors=remount-ro 0       1
# /boot was on /dev/sda2 during installation
UUID=dbc5b2e9-d9be-4c0f-a8b3-4ec0b12807b0 /boot           ext4    defaults
0       2
# /boot/efi was on /dev/sda1 during installation
UUID=CA14-B8EF  /boot/efi       vfat    umask=0077      0       1
/dev/mapper/vol2data-LVhome /home           ext4    defaults        0       2
/dev/mapper/vol2data-LVtmp /tmp            ext4    defaults        0       2
/dev/mapper/vol2data-LVswap none            swap    sw              0       0
/dev/sr0        /media/cdrom0   udf,iso9660 user,noauto     0       0

lvs
 LVroot vol1sys  -wi-ao----  21,88g
 LVhome vol2data -wi-ao---- 497,00g
 LVswap vol2data -wi-ao----  11,53g
 LVtmp  vol2data -wi-ao----   7,54g

systemd version: 232-7
--

- I have tried to fresh install from Stretch alpha 8 netinst cd - the same
result as above.
- According to https://freedesktop.org/wiki/Software/systemd/Debugging/
instructions i catched shutdown log - see below.
- Problem occurs in eight out of ten shutdown attempts
- Problem does not exist with identical disk/lvm/luks setup with Jessie release
on the same machine.
- I'm not 100% if it's systemd related problem - rather correlation between
systemd, and my specific setup (LUKS and LVM configuration)
--
Shutdown log:
[..cut]
[  845.664006] systemd-logind[711]: System is powering down.
[  845.673462] systemd[1]: Stopping User Manager for UID 118...
[  845.673602] systemd[1]: Stopping PackageKit Daemon...
[  845.673698] systemd[1]: Stopping Authorization Manager...
[  845.673769] systemd[1]: Stopping ACPI event daemon...
[  845.673789] systemd[1]: Closed Load/Save RF Kill Switch Status /dev/rfkill
Watch.
[  845.673820] systemd[1]: Stopped target RPC Port Mapper.
[  845.673970] systemd[1]: Removed slice system-getty.slice.
[  845.673991] systemd[1]: Stopped target Graphical Interface.
[  845.674066] systemd[1]: Stopping GNOME Display Manager...
[  845.674166] systemd[1]: Stopping Accounts Service...
[  845.702003] gnome-session-f[2427]: segfault at 0 ip 00007f391ecf0a29 sp
00007ffff2e8b660 error 4 in libgtk-3.so.0.2200.4[7f391ea0e000+6f7000]
[  846.014180] systemd-logind[711]: Removed session 3.
[  935.836164] systemd[1]: dev-dm\x2d0.device: Job dev-dm\x2d0.device/stop
timed out.
[  935.836179] systemd[1]: Timed out stopping /dev/dm-0.
[  935.836733] systemd[1]: dev-dm\x2d0.device: Job dev-dm\x2d0.device/stop
failed with result 'timeout'.
[  935.836751] systemd[1]: session-c2.scope: Stopping timed out. Killing.
[  935.836857] systemd[1]: session-c2.scope: Killing process 1199 (Xorg) with
signal SIGKILL.
[  935.837060] systemd[1]: dev-disk-by\x2did-
dm\x2duuid\x2dCRYPT\x2dLUKS1\x2dca3b486006714690b77172cbdd6e9bc6\x2dsda5_crypt.device:
Job dev-disk-by\x2did-
dm\x2duuid\x2dCRYPT\x2dLUKS1\x2dca3b486006714690b77172cbdd6e9bc6\x2dsda5_crypt.device/stop
timed out.
[  935.837072] systemd[1]: Timed out stopping /dev/disk/by-id/dm-uuid-CRYPT-
LUKS1-ca3b486006714690b77172cbdd6e9bc6-sda5_crypt.
[  935.837618] systemd[1]: dev-disk-by\x2did-
dm\x2duuid\x2dCRYPT\x2dLUKS1\x2dca3b486006714690b77172cbdd6e9bc6\x2dsda5_crypt.device:
Job dev-disk-by\x2did-
dm\x2duuid\x2dCRYPT\x2dLUKS1\x2dca3b486006714690b77172cbdd6e9bc6\x2dsda5_crypt.device/stop
failed with result 'timeout'.
[  935.837631] systemd[1]: dev-disk-by\x2did-
lvm\x2dpv\x2duuid\x2dMQsHwx\x2de5OK\x2dYfId\x2d92tm\x2d2S0K\x2dfUyt\x2dWWBI6n.device:
Job dev-disk-by\x2did-
lvm\x2dpv\x2duuid\x2dMQsHwx\x2de5OK\x2dYfId\x2d92tm\x2d2S0K\x2dfUyt\x2dWWBI6n.device/stop
timed out.
[  935.837639] systemd[1]: Timed out stopping /dev/disk/by-id/lvm-pv-uuid-
MQsHwx-e5OK-YfId-92tm-2S0K-fUyt-WWBI6n.
[  935.844134] nvidia-modeset: Freed GPU:0 (GPU-42faeec1-6cc5-722a-dacc-
46d27ae63f20) @ PCI:0000:01:00.0
[  940.974095] systemd-cryptsetup[2602]: Failed to deactivate: Device or
resource busy
[  940.984290] systemd[1]: systemd-cryptsetup@sda5_crypt.service: Control
process exited, code=exited status=1
[  940.984674] systemd[1]: Stopped Cryptography Setup for sda5_crypt.
[  940.989390] systemd[1]: systemd-cryptsetup@sda5_crypt.service: Unit entered
failed state.
[  940.989422] systemd[1]: systemd-cryptsetup@sda5_crypt.service: Failed with
result 'exit-code'.
[  940.996617] systemd-cryptsetup[2604]: Failed to deactivate: Device or
resource busy
[  941.001842] systemd[1]: systemd-cryptsetup@sdb1_crypt.service: Control
process exited, code=exited status=1
[  941.002187] systemd[1]: Stopped Cryptography Setup for sdb1_crypt.
[  941.007069] systemd[1]: systemd-cryptsetup@sdb1_crypt.service: Unit entered
failed state.
[  941.007099] systemd[1]: systemd-cryptsetup@sdb1_crypt.service: Failed with
result 'exit-code'.
[  941.007304] systemd[1]: Reached target Unmount All Filesystems.
[  941.012343] systemd[1]: Removed slice system-systemd\x2dcryptsetup.slice.
[  941.076541] systemd-shutdow: 373 output lines suppressed due to ratelimiting
[  941.088207] systemd-shutdown[1]: Sending SIGTERM to remaining processes...
[  941.092611] systemd-journald[390]: Received SIGTERM from PID 1 (systemd-
shutdow).
[  941.139041] systemd-shutdown[1]: Sending SIGKILL to remaining processes...
[  941.142554] systemd-shutdown[1]: Unmounting file systems.
[  941.142752] systemd-shutdown[1]: Remounting '/' read-only with options
'errors=remount-ro,data=ordered'.
[  941.161057] EXT4-fs (dm-1): re-mounted. Opts: errors=remount-ro,data=ordered
[  941.169245] systemd-shutdown[1]: Remounting '/' read-only with options
'errors=remount-ro,data=ordered'.
[  941.169271] EXT4-fs (dm-1): re-mounted. Opts: errors=remount-ro,data=ordered
[  941.169275] systemd-shutdown[1]: All filesystems unmounted.
[  941.169278] systemd-shutdown[1]: Deactivating swaps.
[  941.169326] systemd-shutdown[1]: All swaps deactivated.
[  941.169328] systemd-shutdown[1]: Detaching loop devices.
[  941.170249] systemd-shutdown[1]: All loop devices detached.
[  941.321139] EXT4-fs (dm-1): re-mounted. Opts: errors=remount-ro
[EOF]

Thank you for your efforts and great Debian System
Cheers
Irek.

#848044#10
Date:
2016-12-13 19:26:01 UTC
From:
To:
Additional - see attached my partition scheme
https://drive.google.com/file/d/0B8e6XL6CllmPWW1USm1YbHFxN2s/view

#848044#15
Date:
2017-02-10 01:16:09 UTC
From:
To:
Same here.
Does anyone have a solution to this problem?

#848044#20
Date:
2017-02-10 02:22:52 UTC
From:
To:
Am 10.02.2017 um 02:16 schrieb lumin:

I suspect this is a problem in either LVM/DM or cryptsetup.

You should probably talk to those maintainers.

#848044#27
Date:
2017-02-10 06:33:42 UTC
From:
To:
a similar bug reported against cryptsetup:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=824098

a similar bug reported against lvm2:

https://bugzilla.redhat.com/show_bug.cgi?id=1299178

No solution is found.

#848044#32
Date:
2017-03-29 04:03:23 UTC
From:
To:
Just tried a fresh install using the stretch rc2 amd64 netinst ISO,
and the guided/entire-disk LVM+LUKS install option.

There's no delay at shutdown, but there are errors about stopping
dm-crypt and LVM; see attached screenshot. These consistently
occur at every shutdown, and so far, seem harmless.

A screenshot of the errors as seen at shutdown is attached.

Strangely, they were nowhere to be found in any syslog file after
rebooting; however, after enabling the persistent journal (and
disabling syslog forwarding), I could see them with journalctl -ab1:

Mar 28 21:22:45 stretch unknown[541]: session_get_login1_session_id: assertion 'session != NULL' failed
Mar 28 21:22:45 stretch systemd[1060]: at-spi-dbus-bus.service: Failed with result 'exit-code'.
Mar 28 21:22:45 stretch systemd[1]: Stopped (with error) /sys/devices/virtual/block/dm-0.
Mar 28 21:22:45 stretch systemd[1]: Stopped (with error) /dev/disk/by-id/dm-uuid-CRYPT-LUKS1-f96f4a3e07a84aa48123d83ba6c24f53-vda5_crypt.
Mar 28 21:22:45 stretch systemd[1]: Stopped (with error) /dev/disk/by-id/dm-name-vda5_crypt.
Mar 28 21:22:45 stretch systemd[1]: Stopped (with error) /dev/dm-0.
Mar 28 21:22:45 stretch systemd[1]: Stopped (with error) /dev/disk/by-id/lvm-pv-uuid-ozNpTU-66St-dPt6-SXcq-BDtH-hwD1-hFXNvD.
Mar 28 21:22:45 stretch systemd[1]: Stopped (with error) /dev/mapper/vda5_crypt.
Mar 28 21:22:45 stretch lvmetad[285]: Failed to accept connection errno 11.
Mar 28 21:22:50 stretch systemd-cryptsetup[2065]: Failed to deactivate: Device or resource busy
Mar 28 21:22:50 stretch systemd[1]: systemd-cryptsetup@vda5_crypt.service: Failed with result 'exit-code'.
Mar 28 21:22:50 stretch kernel: systemd-shutdow: 43 output lines suppressed due to ratelimiting

Could this be related?

#848044#37
Date:
2017-03-29 04:35:35 UTC
From:
To:
Am 29.03.2017 um 06:03 schrieb Nathan Dorfman:

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=854699

#848044#42
Date:
2019-12-12 18:27:01 UTC
From:
To:
Witaj, Uprzejmie informujemy, że ten e-mail, który dotarł do Twojej
skrzynki pocztowej, nie jest
błąd, ale został specjalnie skierowany do rozpatrzenia. ja
mam propozycję (7,500.000,00 $) pozostawioną przez mojego zmarłego
klienta inżyniera Carlosa
który nosi przy tobie to samo imię, który pracował i mieszkał tutaj w Lome
Togo Mój zmarły klient i rodzina uczestniczyli w wypadku samochodowym,
który miał miejsce
ich życia. Kontaktuję się z tobą jako najbliższym krewnym zmarłego, więc ty
może otrzymać środki na roszczenia. Zrobię to po twojej szybkiej odpowiedzi
poinformuję cię o sposobach wykonania tego przymierza. skontaktuj się
ze mną na ten temat (brianjesse343@gmail.com)