Re: [systemd-devel] udev and dm inotify problems

2015-07-28 Thread Oleksii Shevchuk


 Most likely you built your LVM/dm userspace without proper udev
 support, or left support in there that creates device nodes on its
 own.

 Nowadays with devtmpfs device nodes are created exclusively by the
 kernel and userspace should never create a single device node. If your
 LVM/DM tools still do, then they have been built with incorrect
 build-time settings.

 Note that LVM/DM issues are probably better discussed at the LVM/DM
 mls than here...

 Lennart

The problem was that I had outdated libudev library in /lib. God knows
how that was happend. 

Thanks to all for support.

//wbr
// Oleksii Shevchuk
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] udev and dm inotify problems

2015-07-27 Thread Lennart Poettering
On Sun, 26.07.15 11:39, Oleksii Shevchuk (alx...@gmail.com) wrote:

 Andrei Borzenkov arvidj...@gmail.com writes:
 
 
  Could you verify with e.g. inotifywatch whether inotify event was
  generated by kernel?
 
 
 It turns out, that for some reason I have several dm devices:
 
 # ls -l /dev/mapper/
 crw-rw 1 root dialout  10, 236 ??? 25 09:52 control
 brw--- 1 root root254,  12 ??? 25 09:52 _dev_dm_5
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Doc - ../dm-3
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Music - ../dm-1
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Tmp - ../dm-2
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-home - ../dm-5
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-kernel - ../dm-7
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-portage - ../dm-4
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-prefix - ../dm-8
 brw--- 1 root root254,   0 ??? 25 09:52 OS-root
 lrwxrwxrwx 1 root root   8 ??? 25 09:52 OS-Software - ../dm-10
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-var - ../dm-9
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-VM - ../dm-6
 brw--- 1 root root254,  11 ??? 26 11:36 swap  SWAP is here
 
 Also I have separate device - /dev/dm-11, with same major/minor.

Most likely you built your LVM/dm userspace without proper udev
support, or left support in there that creates device nodes on its
own.

Nowadays with devtmpfs device nodes are created exclusively by the
kernel and userspace should never create a single device node. If your
LVM/DM tools still do, then they have been built with incorrect
build-time settings.

Note that LVM/DM issues are probably better discussed at the LVM/DM
mls than here...

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] udev and dm inotify problems

2015-07-27 Thread Andrei Borzenkov
В Mon, 27 Jul 2015 08:15:45 +0300
Oleksii Shevchuk alx...@gmail.com пишет:

 Andrei Borzenkov arvidj...@gmail.com writes:
 
  So that it the problem. Does it happen if you use cryptsetup directly?
 
 Yes, with cryptsetup behavior is the same.
 
 I have cryptsetup (1.6.7) and lvm2 (2.02.116).
 
 Btw, does your system behave differently?
 

Yes.

bor@opensuse:~ sudo cryptsetup open --type plain /dev/mapper/system-docker 
--key-file /dev/urandom test
bor@opensuse:~ LC_ALL=C ll /dev/mapper/
total 0
crw--- 1 root root 10, 236 Jun 28 11:05 control
lrwxrwxrwx 1 root root   7 Jun 29 20:24 loop0p2 - ../dm-5
lrwxrwxrwx 1 root root   7 Jun 28 11:05 system-datastore - ../dm-3
lrwxrwxrwx 1 root root   7 Jul 27 12:18 system-docker - ../dm-4
lrwxrwxrwx 1 root root   7 Jun 28 11:05 system-home - ../dm-2
lrwxrwxrwx 1 root root   7 Jun 28 11:05 system-root - ../dm-1
lrwxrwxrwx 1 root root   7 Jun 28 11:05 system-swap - ../dm-0
lrwxrwxrwx 1 root root   7 Jul 27 12:18 test - ../dm-6
bor@opensuse:~ rpm -q cryptsetup device-mapper
cryptsetup-1.6.6-1.1.x86_64
device-mapper-1.02.78-20.2.2.x86_64
bor@opensuse:~ 

You should ask on cryptsetup/device-mapper list why it behaves
differently in your case.
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] udev and dm inotify problems

2015-07-26 Thread Oleksii Shevchuk
Andrei Borzenkov arvidj...@gmail.com writes:


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


It turns out, that for some reason I have several dm devices:

# ls -l /dev/mapper/
crw-rw 1 root dialout  10, 236 ??? 25 09:52 control
brw--- 1 root root254,  12 ??? 25 09:52 _dev_dm_5
lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Doc - ../dm-3
lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Music - ../dm-1
lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Tmp - ../dm-2
lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-home - ../dm-5
lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-kernel - ../dm-7
lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-portage - ../dm-4
lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-prefix - ../dm-8
brw--- 1 root root254,   0 ??? 25 09:52 OS-root
lrwxrwxrwx 1 root root   8 ??? 25 09:52 OS-Software - ../dm-10
lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-var - ../dm-9
lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-VM - ../dm-6
brw--- 1 root root254,  11 ??? 26 11:36 swap  SWAP is here

Also I have separate device - /dev/dm-11, with same major/minor.

inotifywait get CLOSE_WRITE events only when the same device file is used.

// wbr
// Oleksii Shevchuk
 ___
 systemd-devel mailing list
 systemd-devel@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] udev and dm inotify problems

2015-07-26 Thread Andrei Borzenkov
В Sun, 26 Jul 2015 11:39:17 +0300
Oleksii Shevchuk alx...@gmail.com пишет:

 Andrei Borzenkov arvidj...@gmail.com writes:
 
 
  Could you verify with e.g. inotifywatch whether inotify event was
  generated by kernel?
 
 
 It turns out, that for some reason I have several dm devices:
 
 # ls -l /dev/mapper/
 crw-rw 1 root dialout  10, 236 ??? 25 09:52 control
 brw--- 1 root root254,  12 ??? 25 09:52 _dev_dm_5
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Doc - ../dm-3
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Music - ../dm-1
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 Media-Tmp - ../dm-2
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-home - ../dm-5
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-kernel - ../dm-7
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-portage - ../dm-4
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-prefix - ../dm-8
 brw--- 1 root root254,   0 ??? 25 09:52 OS-root
 lrwxrwxrwx 1 root root   8 ??? 25 09:52 OS-Software - ../dm-10
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-var - ../dm-9
 lrwxrwxrwx 1 root root   7 ??? 25 09:52 OS-VM - ../dm-6
 brw--- 1 root root254,  11 ??? 26 11:36 swap  SWAP is here
 
 Also I have separate device - /dev/dm-11, with same major/minor.
 
 inotifywait get CLOSE_WRITE events only when the same device file is used.

So that it the problem. Does it happen if you use cryptsetup directly?
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] udev and dm inotify problems

2015-07-25 Thread Oleksii Shevchuk
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)

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@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@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] udev and dm inotify problems

2015-07-25 Thread Andrei Borzenkov
В Sat, 25 Jul 2015 09:51:25 +0300
Oleksii Shevchuk alx...@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@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@lists.freedesktop.org
 http://lists.freedesktop.org/mailman/listinfo/systemd-devel

___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel