From 747d8cd0e0c6cf73101e24c202fc4db6d6be1c2f Mon Sep 17 00:00:00 2001 From: Thomas Schoebel-Theuer Date: Wed, 20 Aug 2014 20:57:46 +0200 Subject: [PATCH] infra: add new udev rules --- userspace/udev/65-mars.rules | 22 ++++++++++++++++++++++ userspace/udev/README | 26 ++++++++++++++++++++++++++ userspace/{ => udev}/debian-udev.patch | 0 3 files changed, 48 insertions(+) create mode 100644 userspace/udev/65-mars.rules create mode 100644 userspace/udev/README rename userspace/{ => udev}/debian-udev.patch (100%) diff --git a/userspace/udev/65-mars.rules b/userspace/udev/65-mars.rules new file mode 100644 index 00000000..33cc8088 --- /dev/null +++ b/userspace/udev/65-mars.rules @@ -0,0 +1,22 @@ +# This file contains the rules to create named MARS devices. + +# Although I want to clear the sticky bit explicitly via MODE=, it +# does not work. This seems to be an undocumented feature; I found +# only an changelog entry dealing with the sticky bit, which I did +# not understand. Probably the RUN= can be made simpler. + +# The following description is stolen from the DRBD udev rules. +# The rule itself is very different, not stolen. +# DO NOT WRAP THIS LINE +# +# old udev does not understand some of it, +# and would end up skipping only some lines, not the full rule. +# which can cause all sort of trouble with strange-named device nodes +# for completely unrelated devices, +# resulting in unusable network lookback, etc. +# +# in case this is "accidentally" installed on a system with old udev, +# having it as one single line avoids those problems. +# +# DO NOT WRAP THIS LINE +SUBSYSTEM=="block", KERNEL=="mars/*", MODE="00600", GROUP="disk", RUN="/bin/chmod -t /dev/$kernel" diff --git a/userspace/udev/README b/userspace/udev/README new file mode 100644 index 00000000..2856aea9 --- /dev/null +++ b/userspace/udev/README @@ -0,0 +1,26 @@ +TST August 2014 + +On some distros / versions, udev rules for MARS are needed. + +Without any udev rules, /dev/mars/mydata is created with the sticky bit set. +As a result, the device will not vanish when leaving primary state. + +In turn, some commands like "marsadm secondary" will complain about that +by means of timeouts. + +On other distros / versions, catch-all rules are present which _would_ +prevent the sticky bit problem. However, some syntax errors prevent this. + +This directory contains distro- and version-dependent stuff. I did not have +the time to fully analyze all distros / distro versions and their udev +rules. + +Since I am not an expert in writing udev rules (and I just needed +a quickfix for my own work), the files in this directoy should +be regarded as examples. + +For example, the file 65-mars.rules should be copied to /lib/udev/rules.d/ +on some newer Debian distros. OTOH, some elder Debians don't seem to +need this (but may need debian-udev.patch). + +Distro maintainers should improve on this and/or provide better solutions. diff --git a/userspace/debian-udev.patch b/userspace/udev/debian-udev.patch similarity index 100% rename from userspace/debian-udev.patch rename to userspace/udev/debian-udev.patch