1
0
mirror of https://github.com/systemd/systemd.git synced 2024-11-06 08:26:52 +03:00
Commit Graph

423 Commits

Author SHA1 Message Date
Kay Sievers
ebc1ba78ed inotify_add_watch(): do not store watch, if it failed
On Sun, Aug 30, 2009 at 04:36, Marco d'Itri<md@linux.it> wrote:
> inotify_add_watch may fail in udev_watch_begin, and then a link with
> name -1 is created.
> I do not know why, but it happened once on my system:
>
> lrwxrwxrwx 1 root root 27 Aug  4 11:27 -1 -> /devices/virtual/block/ram8
2009-08-30 20:42:06 +02:00
Kay Sievers
2ffc9cc191 change database file names
With very deeply nested devices, We can not use a single file
name to carry an entire DEVPATH. Use <subsystem>:<sysname> as
the database filename, which should also simplify the handling
of devices moving around, as these values will not change but
still be unique.

For the name stack we use the <maj>:<min> now as the filename.

> On Tue, Aug 18, 2009 at 09:59:56AM -0400, Ric Wheeler wrote:
> The first is that udev grumbles during boot about "file name too long"
> like the following:
>
> Aug 17 06:49:58 megadeth udevd-event[20447]: unable to create db file
> '/dev/.udev/db/\x2fdevices\x2fpci0000:00\x2f0000:00:04.0\x2f0000:17:00.0\x2f0000:18:0a.0\x2f0000:1f:00.0\x2fhost11\x2fport-11:0\x2fexpander-11:0\x2fport-11:0:0\x2fexpander-11:1\x2fport-11:1:0\x2fexpander-11:2\x2fport-11:2:17\x2fexpander-11:3\x2fport-11:3:1\x2fend_device-11:3:1\x2fbsg\x2fend_device-11:3:1':
> File name too long
2009-08-19 20:49:49 +02:00
Kay Sievers
24d1fea8bd warn about non-readable or empty rules file 2009-08-19 07:34:07 +02:00
Kay Sievers
8e2470d68e print warning for NAME="%k" - it breaks the kernel supplied DEVNAME 2009-08-19 07:31:39 +02:00
Kay Sievers
cb6268f419 udevd: block for 15 seconds after error when too old kernel is detected
The compat code will go away some day and CONFIG_SYSFS_DEPRECATED
kernels fail in too many setups now to be worth to support them.
2009-08-08 22:59:41 +02:00
Alan Jenkins
214a6c791c fix spelling
Fix spelling in docbook comments, code comments, and a local variable
name.  Thanks to "ispell -h" for docbook HTML and "scspell" for source
code.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-08-08 15:42:05 +02:00
Diego Elio 'Flameeyes' Pettenò
59d93adb29 Merge libudev, udev, and the unconditional extras in a single Makefile.am.
Instead of using multiple recursive Makefile.am files, use a single
Makefile.am that sets and builds all the basic suite of libraries and
binaries for udev. This reduces the number of files in the source tree, and
also reduces drastically the build time when using parallel-make.

With this setup, all the compile steps will be executed in parallel, and
just the linking stage will be (partially) serialised on the libraries
creation.
2009-08-07 19:15:28 +02:00
Alan Jenkins
5bdba42ddb man: SYMLINK can be matched as well as assigned
If by-path / by-id links don't quite do what you want, this is a nice
clean way to extend the behaviour.  Real example:

SYMLINK=="serial/by-id/usb-Novatel_Wireless_Inc*CDMA*-if00-port0", \\
 SYMLINK+="cellcard"

Some users ask how to do things like this.

 - create an additional link with a shorter name
 - create a link which matches more loosely
    (omit certain path segments e.g. serial numbers)
 - change permissions on certain USB device nodes

Allow them to realize this without reading the friendly *.c files.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-08-07 14:46:42 +02:00
Alan Jenkins
8e534e2a47 man: fix unused, inaccurate metadata
Dates aren't shown in the manpages.  So they are not really useful,
and no-one is going to remember to update them.

"<refmiscinfo class="version"></refmiscinfo>" sounds even less useful.

I leave the unused "title" and "productname" tags.  They could
theoretically be useful, and aren't hard to maintain.  We just need to
fix the "title" for udevadm.

Signed-off-by: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
2009-08-07 14:46:42 +02:00
Kay Sievers
16dd0aa922 "record_failed" -> "fail_event_on_error" 2009-08-06 19:23:06 +02:00
Kay Sievers
f7c5b04f69 re-enable failed event tracking
It did not work for the last couple of releases.

If RUN{record_failed}+="..." is given, a non-zero execution will mark
the event as failed. Recorded failed events can be re-triggered with:
  udevadm trigger --type=failed

The failed tracking _might_ be useful for things which might not be
ready to be executed at early bootup, but a bit later when the needed
dependencies are available. In many cases though, it indicates that
something is used in a way it should not.
2009-08-06 16:16:26 +02:00
Kay Sievers
fc206fbe3e update a few years of copyright 2009-08-01 09:39:18 -04:00
Kay Sievers
2a827c959a make: build internal tools against libudev-private.la 2009-07-25 20:37:45 +02:00
Kay Sievers
d5b5a611ae format names are not case insensitive 2009-07-23 20:30:52 +02:00
Kay Sievers
cf5bd04073 udevadm: trigger - add --sysname-match=
$ udevadm trigger -n -v --subsystem-match=usb --sysname-match=2-1.1*
  /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.1
  /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.1/2-1.1.1
  /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.1/2-1.1.1/2-1.1.1:1.0
  /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.1/2-1.1.2
  /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.1/2-1.1.2/2-1.1.2:1.0
  /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.1/2-1.1.2/2-1.1.2:1.1
  /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-1/2-1.1/2-1.1:1.0
2009-07-23 00:02:28 +02:00
Kay Sievers
820fc48f24 udevd: add timestamp to --debug output 2009-07-17 13:26:46 +02:00
Kay Sievers
c380472899 udevd: use bool 2009-07-13 03:33:15 +02:00
Kay Sievers
bc113de9a4 udevd: handle SIGCHLD before the worker event message
We may need to handle SIGCHLD before the queued worker message. The last
reference, from the SIGCHLD or the worker message will clean up the worker
context. In case we receive an unexpected SIGCHLD with an error, we let
the event fail and clean up the worker context.
2009-07-13 03:09:05 +02:00
Kay Sievers
adda4c682a udevd: make sure a worker finishes event handling before exiting
Persistent network rules write out new rules files. When rules change,
we need to kill all workers to update the in-memory copy of the rules.
We need to make sure, that a worker finshes its work for all device
messages it has accepted, before it exits after a SIGTERM from the main
process.
2009-07-11 18:21:26 +02:00
Kay Sievers
405c307a72 udevadm: info - add space after R:, A:, W: on database export
<zzam> kay: udevadmin info -e prints all lines with a space after the :, but the W: line
<kay> zzam: yeah, seems so, and the R: and the A:
<zzam> yeah
2009-07-08 17:05:55 +02:00
Kay Sievers
a073cfa844 udevd: detach event from worker if we kill a worker
Jul  8 09:36:41 udevd[663]: worker [5491] did not accept message, kill it
Jul  8 09:36:41 udevd[663]: worker [5491] unexpectedly returned with 0
Jul  8 09:36:41 udevd[663]: worker [5551] unexpectedly returned with 0
Jul  8 09:36:41 kernel: [  156.832086] <6>udevd[663]: segfault at 4 ip 00959fbc sp bfbe7b78 error 6 in udevd[94f000+1c000]

https://bugs.launchpad.net/ubuntu/+source/udev/+bug/396957
2009-07-08 14:13:20 +02:00
Kay Sievers
257bb4cdac use MIN() MAX() from param.h 2009-07-07 19:30:19 +02:00
Kay Sievers
456719b6f9 udevadm: test - print list of properties 2009-07-02 22:56:19 +02:00
Kay Sievers
f045aa1cab man: udev - add private properties like ENV{.FOO}="bar" 2009-06-28 17:10:04 +02:00
Kay Sievers
b25a94549c do not exports properties starting with a '.'
Private variables can be marked like:
  ENV{.FOO}="bar"
2009-06-28 02:21:58 +02:00
Kay Sievers
717244eba0 udev/.gitignore: add udev.pc 2009-06-22 00:33:09 +02:00
Kay Sievers
3ab2be88bd udev.pc: add 2009-06-19 19:17:18 +02:00
Kay Sievers
6133f3432f cleanup ./configure installation directory options 2009-06-17 02:25:07 +02:00
Kay Sievers
045a3bc89e USE_LOG -> ENABLE_LOGGING, DEBUG -> ENABLE_DEBUG, USE_SELINUX -> WITH_SELINUX 2009-06-14 17:53:15 +02:00
Kay Sievers
ff5d99e0b0 udevadm: info -revert "accept --query without argument"
Getopt is too dumb, the optional argument breaks "udevadm -q symlink".
2009-06-10 15:55:24 +02:00
Kay Sievers
98631e1c21 libudev: rename private files to *-private.c 2009-06-09 23:12:12 +02:00
Kay Sievers
44b49d3736 move common stuff from udev/ to private parts of libudev/ 2009-06-09 23:05:25 +02:00
Kay Sievers
9060b066d9 move syslog wrapper to libudev 2009-06-09 22:47:48 +02:00
Kay Sievers
12bc9c54f2 udevd: log info for created/killed workers 2009-06-09 18:31:14 +02:00
Kay Sievers
48a9b173e8 libudev: move to top-level directory 2009-06-08 21:36:06 +02:00
Kay Sievers
15a45c89e5 libudev: add comments to libudev.h 2009-06-08 19:31:07 +02:00
Kay Sievers
45798927f8 udevd: print error if worker dies unexpectedly 2009-06-08 17:16:48 +02:00
Kay Sievers
b0d5e0df3e udevadm: monitor --environment -> --property 2009-06-07 03:07:33 +02:00
Kay Sievers
5654503680 udevadm: control - --env -> --property 2009-06-07 02:53:35 +02:00
Kay Sievers
0254b2118f udevadm: info - accept --query without a value and print properties 2009-06-07 02:39:54 +02:00
Kay Sievers
80381823bc udevadm: trigger - add --property-match=<key>:<value> 2009-06-07 02:07:54 +02:00
Kay Sievers
701a57da31 libudev: enumerate - allow multiple keys with the same name 2009-06-07 01:51:38 +02:00
Kay Sievers
93ee84ce07 fix signed/unsigned warning 2009-06-06 21:19:56 +02:00
Kay Sievers
4950b6e6a8 cleanup $attr{} substitution 2009-06-06 04:54:41 +02:00
Kay Sievers
32028733ee allow format substitution in path of ATTR{<path>}=="<value>" 2009-06-06 04:52:52 +02:00
Kay Sievers
a25d547dd4 udevd: use enum instead of char in struct declaration 2009-06-05 23:27:11 +02:00
Kay Sievers
9290143d2d udevd: close netlink socket in worker and set cloexec 2009-06-04 02:49:42 +02:00
Kay Sievers
1e03b754ae udevd: convert to event worker processes
Event processes now get re-used after they handled an event. This reduces
pressure on the CPU significantly because cloned event processes no longer
cause page faults in the main daemon. After the events have settled, the
no longer needed worker processes get killed.
2009-06-04 01:44:04 +02:00
Kay Sievers
b61f48a0e8 str[sp]cpyl: add __attribute__ ((sentinel)) 2009-06-01 21:10:29 +02:00
Kay Sievers
82c785e5dc udevd: remove check for dev_t, DEVPATH_OLD takes care of that 2009-05-29 18:54:03 +02:00