[systemd-devel] [PATCH] unit: When stopping due to BindsTo=, log which unit caused it
Martin Pitt
martin.pitt at ubuntu.com
Sun Mar 1 03:43:27 PST 2015
Hey Lennart,
Lennart Poettering [2015-02-28 17:40 +0100]:
> This is implemented now. Please check if this fixes this issue for
> you.
This fixes the bad unmounts at boot, but also breaks the automatic cleanup of
stale mounts after CD ejection. After inserting a medium, the .device looks ok:
$ systemctl show dev-sr1.device
SysFSPath=/sys/devices/pci0000:00/0000:00:01.1/ata2/host1/target1:0:0/1:0:0:0/block/sr1
Id=dev-sr1.device
Names=dev-sr1.device
Following=sys-devices-pci0000:00-0000:00:01.1-ata2-host1-target1:0:0-1:0:0:0-block-sr1.device
Wants=media-martin-Fedora\x5cx2dLive\x5cx2dLXDE\x5cx2dx86_64\x5cx2d21\x5cx2d5.mount
BoundBy=media-martin-Fedora\x5cx2dLive\x5cx2dLXDE\x5cx2dx86_64\x5cx2d21\x5cx2d5.mount
Before=media-martin-Fedora\x5cx2dLive\x5cx2dLXDE\x5cx2dx86_64\x5cx2d21\x5cx2d5.mount
Description=QEMU_DVD-ROM Fedora-Live-LXDE-x86_64-21-5
LoadState=loaded
ActiveState=active
SubState=plugged
and so does the mount:
$ systemctl show 'media-martin-Fedora\x2dLive\x2dLXDE\x2dx86_64\x2d21\x2d5.mount' > sr1.mount
Where=/media/martin/Fedora-Live-LXDE-x86_64-21-5
What=/dev/sr1
Id=media-martin-Fedora\x5cx2dLive\x5cx2dLXDE\x5cx2dx86_64\x5cx2d21\x5cx2d5.mount
Names=media-martin-Fedora\x5cx2dLive\x5cx2dLXDE\x5cx2dx86_64\x5cx2d21\x5cx2d5.mount
Requires=-.mount
Wants=system.slice
BindsTo=dev-sr1.device
WantedBy=dev-sr1.device
Conflicts=umount.target
Before=local-fs.target umount.target
After=local-fs-pre.target system.slice -.mount systemd-journald.socket dev-sr1.device
RequiresMountsFor=/media/martin
Description=/media/martin/Fedora-Live-LXDE-x86_64-21-5
LoadState=loaded
ActiveState=active
SubState=mounted
SourcePath=/proc/self/mountinfo
but after ejecting the mount still stays around. The device unit does
to activating/tentative, and the .mount unit is unchanged from the above.
Supposedly this line is the interesting one:
systemd[1]: dev-sr1.device changed plugged -> tentative
which in this case really should become "dead". The full debug journal
is at http://people.canonical.com/~pitti/tmp/journal-cd-eject.txt
Thanks,
Martin
--
Martin Pitt | http://www.piware.de
Ubuntu Developer (www.ubuntu.com) | Debian Developer (www.debian.org)
More information about the systemd-devel
mailing list