[systemd-devel] udev and dm inotify problems

Andrei Borzenkov arvidjaar at gmail.com
Sat Jul 25 14:03:27 PDT 2015


В Sat, 25 Jul 2015 09:51:25 +0300
Oleksii Shevchuk <alxchk at gmail.com> пишет:

> Hi list.
> 
> I ran into the strange problem.
> After creating encrypted swap (with crypttab) boot hangs. That happens
> because systemd waits for dev-mapper-swap.device.
> 
> Udev doesn't report that this device active, because SYSTEMD_READY
> environment set to "0".
> 
> That happens because "change" event was not generated.
> 
> "Change" event was not generated, because udev doesn't receive inotify
> event after mkswap closes device.
> 
> I come to this after verifying manually these steps:
> 1. Set udev log_level to debug
> 2. Attach device with systemd-cryptsetup
> 3. Verify that inotify for device was added (no errors in debug log,
>    device in /run/udev/watch). Also I attach strace to systemd-udev.
> 4. Run mkswap /dev/mapper/swap
> 5. Check, that there was no any activity by systemd-udev (according to
>    strace - no event, according to the logs - no processing)
> 

Could you verify with e.g. inotifywatch whether inotify event was
generated by kernel?

> After figuring out this, I double check systemd requirements with
> /README.txt
> 
> I'm running linux-4.1.3, systemd (c11ae0bacee4ab835526a7408f619a754b3b848e)
> Also I have this in config
> 
> CONFIG_FHANDLE=y
> CONFIG_CGROUPS=y
> CONFIG_CGROUP_SCHED=y
> CONFIG_FAIR_GROUP_SCHED=y
> CONFIG_CHECKPOINT_RESTORE=y
> CONFIG_NET_NS=y
> CONFIG_EPOLL=y
> CONFIG_SIGNALFD=y
> CONFIG_TIMERFD=y
> CONFIG_SECCOMP_FILTER=y
> CONFIG_BLK_DEV_BSG=y
> CONFIG_EFI_PARTITION=y
> CONFIG_SECCOMP=y
> CONFIG_DEVTMPFS=y
> CONFIG_DEVTMPFS_MOUNT=y
> CONFIG_DEVPTS_MULTIPLE_INSTANCES=y
> CONFIG_DMIID=y
> CONFIG_EXT3_FS_POSIX_ACL=y
> CONFIG_EXT4_FS_POSIX_ACL=y
> CONFIG_REISERFS_FS_POSIX_ACL=y
> CONFIG_XFS_POSIX_ACL=y
> CONFIG_BTRFS_FS_POSIX_ACL=y
> CONFIG_F2FS_FS_POSIX_ACL=y
> CONFIG_FS_POSIX_ACL=y
> CONFIG_INOTIFY_USER=y
> CONFIG_AUTOFS4_FS=m
> CONFIG_PROC_FS=y
> CONFIG_SYSFS=y
> CONFIG_TMPFS_POSIX_ACL=y
> CONFIG_TMPFS_XATTR=y
> CONFIG_EFIVAR_FS=m
> CONFIG_SCHED_DEBUG=y
> CONFIG_SCHEDSTATS=y
> 
> I use next workaround:
> 
> cat /etc/systemd/system/systemd-cryptsetup at swap.service.d/override.conf 
> [Service]
> ExecStartPost=/usr/bin/udevadm trigger -t devices -p SYSTEMD_READY=0
> 
> So.. What I should check to make all that run properly?
> 
> // wbr
> // Oleksii Shevchuk
> _______________________________________________
> systemd-devel mailing list
> systemd-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/systemd-devel



More information about the systemd-devel mailing list