1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-05 23:51:28 +03:00
Commit Graph

480 Commits

Author SHA1 Message Date
Kay Sievers
85f22036fc doc: add section about how *not* to rename device nodes
Thanks to Mario 'BitKoenig' Holbe <Mario.Holbe@tu-ilmenau.de>.
2010-04-20 07:29:51 +02:00
Kay Sievers
6252f9e732 delete only device nodes, not symlinks when deleting a devtmpfs node
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=550152
2010-04-19 18:57:28 +02:00
Kay Sievers
9355f324e1 add O_NOFOLLOW when creating files in link stack 2010-04-19 18:55:10 +02:00
Marco d'Itri
db123fe9f0 doc: document the WAIT_FOR timeout 2010-04-19 12:47:02 +02:00
Kay Sievers
a89d342dfb remove "ignore_remove" option 2010-04-13 12:45:38 +02:00
Kay Sievers
1f084fe581 remove "all_partitions" option
We can not predict the major/minor of non-existing devices:
  $ grep . /sys/class/block/sd*/dev
  /sys/class/block/sda1/dev:259:524288
  /sys/class/block/sda2/dev:259:262144
  /sys/class/block/sda3/dev:259:786432
  /sys/class/block/sda4/dev:259:131072
  /sys/class/block/sda/dev:259:0
  /sys/class/block/sdb/dev:259:655360
  /sys/class/block/sdc/dev:259:393216

If this functionality is still needed for some broken hardware, it needs to be
solved with a tool not part of the udev package. Because such option is unreliable
and unsafe to use.
2010-04-13 08:52:48 +02:00
Kay Sievers
236fae6cf1 udevadm: trigger - switch default action from "add" to "change" 2010-04-12 17:56:32 +02:00
Kay Sievers
3ba7e651ad log info only if we actually delete the node 2010-04-12 17:13:37 +02:00
Kay Sievers
4b06c40935 replace "add|change" with "!remove" 2010-04-12 16:52:41 +02:00
Kay Sievers
5539f624e1 allow IMPORT{db}="KEY" 2010-04-12 15:58:05 +02:00
Kay Sievers
0ec5b5e142 unify/cleanup event handling 2010-04-12 15:51:16 +02:00
Kay Sievers
578cc8a808 do not reset SELinux context when the node was not touched 2010-03-17 09:15:18 +01:00
Kay Sievers
777239cb21 use major:minor as entries in watch directory 2010-03-10 18:54:35 +01:00
Kay Sievers
af24bb178e use major:minor as entries in symlink stack instead of devpath 2010-03-10 17:29:27 +01:00
Kay Sievers
a00ff5db02 udevadm: monitor - use / as separator in --subsystem-match=subsystem[/devtype] 2010-03-10 15:00:00 +01:00
Kay Sievers
fbb31cd6e1 libbudev-private: rename udev_list_entry_get_flag() 2010-03-10 14:52:42 +01:00
Kay Sievers
455f792e47 replace utimes() with utimensat() 2010-03-10 14:43:07 +01:00
Kay Sievers
044bd2bcc7 udevadm: fix untested and broken commit to set buffer size 2010-02-18 11:03:28 +01:00
Scott James Remnant
0fe3c26eab udevadm monitor: increase netlink buffer size
A common use (e.g. in Ubuntu) for udevadm monitor is to log the events
received by udev during boot; events can be lost of the buffer size isn't
increased as udevd does.

Signed-off-by: Scott James Remnant <scott@ubuntu.com>
2010-02-17 15:27:36 +00:00
Kay Sievers
7b4038a96f clarify message about not removed device node 2010-01-15 00:32:10 +01:00
Kay Sievers
889dd1061c do not remove device nodes of active kernel devices
We do no longer delete the primary device node while handling "remove"
events if the same kernel device is already re-created in the meantime.
This prevents the asynchronously running udev from removing and re-creating
primary device nodes for active devices.
2010-01-13 13:18:14 +01:00
Kay Sievers
6f1892dc7a udevd: inotify - do not parse rules at create but at close
We do not need to get notified about created files, only about moved
ones or files closed-after-writing.
2010-01-13 13:09:02 +01:00
Kay Sievers
d5a01cb8b3 udevadm: logging - copy va_list and do not use it twice 2009-12-25 16:14:22 +01:00
Kay Sievers
f46d2e54a8 remove UDEV_RUN environment variable
It handles only RUN but not IMPORT and PROGRAM. There is no sane way
to suppress program execution. Most important programs run with IMPORT
these days. Also events can no longer suppressed with the libudev
netlink messages, so UDEV_RUN does nothing useful and is just
inconsistent.
2009-12-25 15:23:45 +01:00
Kay Sievers
1d67ec16c4 fix typo in log message priority handling 2009-12-25 14:47:59 +01:00
Kay Sievers
299650f1e3 udevadm: info - fix info --root --query=name --path= for device without a device node
Subject: Bug#561279: udev: Crash location and first-level cause
Reply-To: Stephen Kitt <steve@sk2.org>, 561279@bugs.debian.org
2009-12-24 20:42:02 +01:00
Martin Pitt
7729cd2fad Clarify RUN/IMPORT documentation
Explain command/argument separation rules, search path, and quoting for RUN and
IMPORT.

http://bugs.debian.org/550206
2009-12-22 13:08:23 +01:00
Kay Sievers
5607391481 update mtime of nodes and links when we re-use them 2009-12-18 21:25:13 +01:00
Kay Sievers
3c1898863f remove remaining support for CONFIG_SYSFS_DEPRECATED 2009-12-15 16:14:14 +01:00
Kay Sievers
86f77493bd test-udev: remove "ignore_device" code 2009-11-16 23:40:27 +01:00
Kay Sievers
6d87ee2e00 print warning for BUS=, SYSFS{}=, ID= 2009-11-16 23:39:33 +01:00
Kay Sievers
cdae488a3f remove "ignore_device"
There is no way to ignore an event these days. Libudev events can
not be suppressed. It only prevents RUN keys from being executed,
which results in an inconsistent behavior in current setups.
2009-11-16 15:22:17 +01:00
Kay Sievers
081be002ea udevd: create /dev/.udev/rules.d/ before watching it wit inotify
This should also address:

On Tue, Nov 3, 2009 at 16:21, Marco d'Itri <md@linux.it> wrote:
> udev_rules_new() in udev/udev-rules.c unconditionally creates the
> directory.
> This is a problem because the function is called also by e.g. udevadm
> test, and creating /dev/.udev/ when it does not exist is an unacceptable
> side effect which will break everything else that checks for its
> existence to know if udev is running.
2009-11-04 17:06:52 +01:00
Martin Pitt
495d408b36 fix major fd leak in link handling
link_find_prioritized(): Properly close directory handles to fix a major fd
leak which caused hotplugging to fail entirely in many cases due to having too
many open files.

https://launchpad.net/bugs/463347
2009-11-03 00:03:43 +01:00
Kay Sievers
bc3ec7bd45 unblock signals we might want to handle
On Thu, Oct 29, 2009 at 19:15, Christian P. Schmidt <schmidt@digadd.de> wrote:
> After the getty replaces itself with login the pam module pam_mount
> calls mount. This in turn determines that the partition to be mounted is
> LUKS encrypted, and calls cryptsetup. Cryptsetup receives the password,
> unlocks the partition, and calls udevadm settle in order to avoid some
> problems in interaction with LVM.
>
> udevadm settle never returns.
>
> The problem here is that SIGUSR1 and SIGALRM are both blocked in oldmask
> already, and never reach udevadm. No care is ever taken to ensure those
> signals are not blocked.
2009-10-31 11:53:41 +01:00
Kay Sievers
26347a4c55 use CLOEXEC flags instead of fcntl() 2009-10-30 12:39:04 +01:00
Kay Sievers
bfbf65aad0 remove "last_rule" option
Its use breaks too many things which expect to be run from independent
later rules, and is an idication that something needs to be fixed
properly instead.
2009-10-28 11:45:32 +01:00
Kay Sievers
6834a44299 break loops if util_create_path() returns error
Dangling symlinks in path components return -ENOENT. Do not retry
to create the file in a loop in such case.
2009-10-28 11:37:20 +01:00
Kay Sievers
19711e1933 udevd: serialize events for with the same major/minor
On Wed, Oct 7, 2009 at 21:46, Alan Jenkins <sourcejedi.lkml@googlemail.com> wrote:
> Udev would have avoided the race prior to
>
> 82c785e "udevd: remove check for dev_t, DEVPATH_OLD takes care of that"
>
> (the "check" removed here used to serialize events based on the device
> major:minor number).

On Wed, Oct 7, 2009 at 22:31, Michael Guntsche <mike@it-loops.com> wrote:
> add      /module/8250_pnp (module)
> remove /devices/platform/serial8250/tty/ttyS0 (tty)
> add      /devices/pnp0/00:05/tty/ttyS0 (tty)
2009-10-08 00:06:23 +02:00
Andrew Church
4daa146bf7 fix wrong parameter size on ioctl FIONREAD
On Wed, Sep 23, 2009 at 23:11, Matthias Schwarzott <zzam@gentoo.org> wrote:
> It is about ioctl failures on amd64:
>   http://bugs.gentoo.org/show_bug.cgi?id=286041
>
> A bad parameter type to an ioctl() call causes udev-146 to generate "error
> getting buffer for inotify" messages in syslog.  The offending code is
> roughly:
>
>    ssize_t nbytes, pos;
>    // ...
>    ioctl(fd, FIONREAD, &nbytes);
>
> where ssize_t is 64 bits on amd64, but the kernel code for FIONREAD (at least
> through gentoo-sources-2.6.31) uses type int:
>
>    p = (void __user *) arg;
>    switch (cmd) {
>    case FIONREAD:
>        // ...
>        ret = put_user(send_len, (int __user *) p);
>
> so the upper 32 bits of "nbytes" are left uninitialized, and the subsequent
> malloc(nbytes) fails unless those 32 bits happen to be zero (or the system has
> a LOT of memory).
2009-09-24 10:53:10 -07:00
Harald Hoyer
6068553195 rename interfaces to <iface>_rename if rename fails 2009-09-18 13:14:30 +02:00
Kay Sievers
bcb8b2315b fix SYMLINK{} option parsing 2009-09-16 18:14:03 +02:00
Kay Sievers
ca508dd94d udevadm: control - remove compat code 2009-09-14 14:29:05 +02:00
Marco d'Itri
2079b52e17 udevadmi: control = exit with rc=2 if there is some system error 2009-09-14 14:05:31 +02:00
Marco d'Itri
bbfeee28fc udevadm: print all messages to stderr with priority higher or equal than LOG_ERR
It is needed to prevent errors in udev from going unnoticed (e.g.
when udevd is not running).
2009-09-14 13:56:38 +02:00
Kay Sievers
b6a2637524 put util_create_path() and file creastion in a retry loop
On 8/29/09, Florian Zumbiehl <florz@florz.de> wrote:
> Could it happen that > util_create_path() and util_delete_path()
> do run in parallel for > the same directory? After all, util_create_path()
> does handle > the case where creation of the directory happens in parallel
> to it running, so it doesn't seem all that unlikely to me ...
2009-09-10 02:08:05 +02:00
Kay Sievers
676d294c23 reorder create_path() and node/link creation to be called in a direct sequence 2009-09-10 01:35:48 +02:00
Kay Sievers
6c29f2b942 simplify "symlink name stack"
With well defined and kernel-supplied node names, we no longer need
to support a possible stack of conflicting symlinks and node names.
Only symlinks with identical names can be claimed by multiple devices.

This shrinks the former /dev/.udev/names/ significantly.

Also the /dev/{block,char}/MAJ:MIN" links are excluded from the name
stack - they are unique and can not conflict.
2009-09-09 18:49:07 +02:00
Kay Sievers
78715f65c9 fix randonm findings from llvm-clang-analyzer
Thanks to Lennart for the log file!
2009-09-08 22:11:04 +02:00
Kay Sievers
335e316a71 fix whitespace 2009-09-07 12:15:29 +02:00