1
1
mirror of https://github.com/systemd/systemd-stable.git synced 2024-10-31 07:51:08 +03:00
Commit Graph

72 Commits

Author SHA1 Message Date
kay.sievers@vrfy.org
821d0ec803 [PATCH] add RUN key to be able to run rule based notification
SUBSYSTEM=="block", RUN="/sbin/program"
  will execute the program only for block device events.

ACTION="remove", SUBSYSTEM=="block", RUN"/sbin/program"
  will execute the program, if a block device is removed.
2005-04-26 23:55:00 -07:00
kay.sievers@vrfy.org
6b493a20e1 [PATCH] support log-priority levels in udev.conf 2005-04-26 23:54:59 -07:00
kay.sievers@vrfy.org
7f7ae03a62 [PATCH] udevd: don't delay events with TIMEOUT in the environment
On Tue, 2005-03-15 at 09:25 +0100, Hannes Reinecke wrote:
> The current implementation of the firmware class breaks a fundamental
> assumption in udevd: that the physical device can be initialised fully
> prior to executing the next event for that device.

Thanks to Hannes for the patch.
2005-04-26 23:53:53 -07:00
kay.sievers@vrfy.org
138068d690 [PATCH] fix ia64 compile 2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
63f61c5cf6 [PATCH] replace strncpy()/strncat() by strlcpy()/strlcat() 2005-04-26 23:51:00 -07:00
kay.sievers@vrfy.org
6c18b1fb87 [PATCH] rename LOG to USE_LOG in all places 2005-04-26 23:48:48 -07:00
kay.sievers@vrfy.org
f8a178a35b [PATCH] trivial rename of some variables 2005-04-26 23:36:14 -07:00
mbuesch@freenet.de
0786e8e541 [PATCH] udevd: fix valgrind warning
==4304== Syscall param sigaction(act) contains uninitialised or unaddressable byte(s)
==4304==    at 0x804A37B: (within /sbin/udevd)
==4304==  Address 0x52BFE7FC is on thread 1's stack
2005-04-26 23:24:19 -07:00
kay.sievers@vrfy.org
085cce379a [PATCH] udevd: throttle the forking of processes
If the system reaches a defined limit of processes in running state, udevd
starts to count its own processes in running state from its session (all
forked hotplug child processes, subprocesses and callouts) and throttles
further process forking if the limit is reached.
  
This should help setups with hundreds of events emitted hotplug events
in parallel with hundreds of processes in "R" state. which makes the machine
unresponsible.
  
I placed a 100% cpu time consuming program in /etc/hotplug.d/ which runs for 5
seconds. With this patch I can load "scsi_debug add_host=100" without any major
problem. Without the patch the box is completly unresponsible for many minutes.
2005-04-26 23:21:58 -07:00
kay.sievers@vrfy.org
1e26698933 [PATCH] udevd: add possible initialization of expected_seqnum
UDEVD_EXPECTED_SEQNUM=$[`cat /sys/kernel/hotplug_seqnum` + 1] ./udevd -d
will init udevd, so the next event will not wait for any timeout.
2005-04-26 23:21:58 -07:00
kay.sievers@vrfy.org
ce043f851d [PATCH] udevd: it's obviously not the brightest idea to exit a device node manager if it doesn't find /dev/null 2005-04-26 23:21:58 -07:00
kay.sievers@vrfy.org
c2cf40123f [PATCH] udevd: separate socket handling to prepare for other event sources 2005-04-26 23:21:58 -07:00
kay.sievers@vrfy.org
f15515b59f [PATCH] udevd: support -d switch to become a daemon 2005-04-26 23:21:58 -07:00
kay.sievers@vrfy.org
021a294c04 [PATCH] udevd: split up message receiving an queueing 2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
7b6571a9fc [PATCH] improve event sequence serialization
We delay the execution of events if there is already an event running for
the same device, a parent or a child device. "add" events with a reference
to a physical device will also wait for the physical device to finish.
  
Here we fix the devpath comparison logic to return "busy" only if a complete
device names is matching. /block/sdaa will not longer block a /block/sda event.
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
8b72687876 [PATCH] limit the initial timeout of the udevd event handling
Define an inititialization phase, where we delay the events only
for a short time to eventually recollect the event sequence instead
of delaying the very first events for 10 seconds, which breaks the
firmware loader.
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
eabfc97367 [PATCH] handle renamed network interfaces properly if we manage hotplug.d/
If we take over the hotplug call and manage the events we don't need
to call the event fake script in dev.d/. Just set all expected values
to the new network interface name and call hotplug.d/. This way the
device renaming is completely handled inside of udev and userspace
can't get confused.
2005-04-26 23:19:09 -07:00
kay.sievers@vrfy.org
82ca88904d [PATCH] klibc supports LOG_PID now, so remove our own implementation 2005-04-26 23:17:47 -07:00
kay.sievers@vrfy.org
79721e0a77 [PATCH] udevd: serialization of the event sequence of a chain of devices
Currently udevd delays only events for the same DEVPATH.

Example of an "add" event sequence:
  /block/sda
  /block/sda/sda1

With this change, we make sure, that the udev process handling
/block/sda has finished its work (waited for all attributes,
created the node) before we fork the udev event for /block/sda/sda1.
This way the event for sda1 can be sure, that the node for the
main device is already created (may be useful for disk labels).

It will not affect any parallel device handling, only the sequence
of the devices directory chain is serialized. The 10.000 disks
plugged in will still run as parallel events. :)

The main motivation to do this is the program execution of the
dev.d/ and hotplug.d/ directory. If we don't wait for the parent
event to exit, we can't be sure that the executed scripts are
run in the right order.

On Thu, Dec 09, 2004 at 09:18:28AM +0100, Kay Sievers wrote:
> On Wed, 2004-12-08 at 19:07 -0800, David Brownell wrote:
> > Could that argument apply to the underlying hardware, too?

> We now make sure that the sequence of events for a device
> is serialized for every device chain and the class/block
> devices which have a "device" link to a physical device are
> handled after the physical device is fully populated and
> notified to userspace. It will only work this way on kernels
> later than 2.6.10-rc1 cause it depends on the PHYSDEVPATH
> value in the hotplug environment.
2005-04-26 23:13:47 -07:00
kay.sievers@vrfy.org
4497fcbf71 [PATCH] udevsend/udevd handle events without a subsystem
Accept event without a subsystem and pass it through udevd.
Pass empty environment while starting udevd.
2005-04-26 23:00:29 -07:00
kay.sievers@vrfy.org
9af5bb2f8f [PATCH] rename udev_lib to udev_utils and dev_d to udev_multiplex 2005-04-26 22:44:02 -07:00
kay.sievers@vrfy.org
6f59ed5547 [PATCH] add MANAGED_EVENT to the forked udev environment
This will prevent a loop, if udev sends events back into the
daemon.
2005-04-26 22:35:00 -07:00
kay.sievers@vrfy.org
f602ccf072 [PATCH] close connection to syslog in forked udevd child 2005-04-26 22:30:28 -07:00
kay.sievers@vrfy.org
ec9cc0127d [PATCH] udevd exit path cleanup 2005-04-26 22:30:28 -07:00
kay.sievers@vrfy.org
80513ea38f [PATCH] prevent udevd crash if DEVPATH is not set
Just move the event straight to the exec list and don't try
to compare a NULL pointer.
2005-04-26 22:30:27 -07:00
kay.sievers@vrfy.org
13f24d596c [PATCH] remove udev_lib dependency from udevsend, which makes it smaller 2005-04-26 22:24:30 -07:00
kay.sievers@vrfy.org
4a231017ff [PATCH] pass the whole event environment to udevd
Make _all_ hotplug variables available to the forked udev,
the udev callouts and the udev dev.d/ scripts. We put the
whole environment into a buffer and send it over the udevd
socket. udevd recreates *envp[] and passes it to the exec().
2005-04-26 22:18:32 -07:00
kay.sievers@vrfy.org
5a73b25fd6 [PATCH] Don't use any syslog() in signal handler, cause it may deadlock. 2005-04-26 22:09:26 -07:00
kay.sievers@vrfy.org
f8c1ccde6a [PATCH] improve klibc fixup integration 2005-04-26 22:06:44 -07:00
kay.sievers@vrfy.org
5cab7caa2a [PATCH] cleanup udevd/udevstart
Change to the same timeout loop we use in the rest of the code. Change
some comments and names to be more descriptive.

I'm mostly finished with the overall cleanup. I will post a new patch
for the udevd-nofork experiment, which will be much smaller now.
2005-04-26 22:06:44 -07:00
greg@kroah.com
1ceba9360b [PATCH] sparse cleanups on the tree 2005-04-26 22:06:44 -07:00
kay.sievers@vrfy.org
7257cb1845 [PATCH] close the syslog
Seems that we never closed the opened syslog.
Here is a patch to do this in all our binaries.
2005-04-26 22:02:45 -07:00
mbuesch@freenet.de
e5a5b54ab6 [PATCH] fix asmlinkage
This patch fixes the reintroduced bug with the
sig_handler(), if we link against a -mregparm=3 compiled
klibc on i386.
It also fixes some compiler warnings about redefined
asmlinkage on some systems.
Also some (broken?) compilers on distros throw out warnings
if asmlinkage is before "static void". This fixes it, too.
2005-04-26 21:55:39 -07:00
mbuesch@freenet.de
dc117daa28 [PATCH] fix incompatible pointer type warning
This patch fixes two
warning: assignment from incompatible pointer type

asmlinkage is the reason for the warning. We can
simply cast to avoid it.

It also fixes this warning:
warning: implicit declaration of function `umask'
2005-04-26 21:53:22 -07:00
harald@redhat.com
6e3e3c3416 [PATCH] PATCH udev close on exec
selinux wants a clean fd set, so better close all open fds
2005-04-26 21:37:03 -07:00
harald@redhat.com
c8fa2d8b41 [PATCH] PATCH some cleanups and security fixes
posted by Steve Grubb on https://bugzilla.redhat.com/bugzilla/show_bug.cgi?id=130351
2005-04-26 21:37:03 -07:00
kay.sievers@vrfy.org
cdc60e8afb [PATCH] switch udev's seqnum to u64
The kernel will use a u64 for the sequence number, so we want the same.
2005-04-26 21:37:01 -07:00
kay.sievers@vrfy.org
3169e8d1ee [PATCH] pass SEQNUM trough udevd
here we change udevd to pass the SEQNUM from the hotplug environment
to udev and the dev.d/ scripts. We need this for HAL to match the
hotplug event with the dev.d/ events.

It also changes the type from int to long to match the kernel.
2005-04-26 21:37:00 -07:00
trini@kernel.crashing.org
807755776d [PATCH] Add 'asmlinkage' to udev-030
The following patch adds 'asmlinkage' defines to udev, to kill off 2
warnings on !i386.

Signed-off-by: Tom Rini <trini@kernel.crashing.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
2005-04-26 21:36:59 -07:00
kay.sievers@vrfy.org
47bf9196c6 [PATCH] fix udevd zombies
The recent version of klibc switched to -mregparm=3. This broke the
signal handlers parameter, cause it is called directly from the kernel
with the parameter on the stack not in a register.
2005-04-26 21:35:47 -07:00
kay.sievers@vrfy.org
84df02dd63 [PATCH] catchup with recent klibc
Our own implementation of the sysinfo system call is no longer
needed, cause it's merged it into klibc now.
2005-04-26 21:35:47 -07:00
kay.sievers@vrfy.org
7d855c3116 [PATCH] udevd test script
Thanks to Yin, Hu <hu.yin@intel.com>, who made a nice perl script to test the
expected behavior of the udevd sequence number handling. The test sends
different SEQNUM sequences to udevd, while analyzing the reordering and timeout
handling of udevd.
2005-04-26 21:35:15 -07:00
kay.sievers@vrfy.org
b6bf0b1236 [PATCH] switch udevd's msg_dump() to #define
Here we switch the msg_dump() to #define instead of commenting it out.
2005-04-26 21:35:14 -07:00
greg@kroah.com
9a689d5863 [PATCH] remove compiler warning from udevd.c 2005-04-26 21:35:14 -07:00
kay.sievers@vrfy.org
9b28a52a0a [PATCH] DEVPATH for netdev
Here we change the DEVPATH for netdev's in the environment of the dev.d/
scripts to the name the device is renamed to. The original name doesn't
exist in the kernel after rename.
2005-04-26 21:35:13 -07:00
kay.sievers@vrfy.org
e5a2989efb [PATCH] udevd race conditions and performance, assorted cleanups - take 2
here is a patch on top of your nice improvements.
I fixed the whitespace and it hopefully fixes the stupid timestamp bug in
udevd. Some stupid OS sets the hwclock to localtime and linux changes it
to UTC while starting. If any events are pending they may be delayed by
the users time distance from UTC :) So we use the uptime seconds now.
2005-04-26 21:35:13 -07:00
chris_friesen@sympatico.ca
f27125f98f [PATCH] udevd race conditions and performance, assorted cleanups
This patch covers a number of areas:

1) sysfs.h is fixed up to use the common dbg() macro.  This fixes the
case where DEBUG is defined but USE_LOG isn't.

2) udevstart.c is modified to include the proper headers, rather than
getting them indirectly which can break depending on Makefile flags

3) udevd.c gets some major changes:
a) I added a pipe from the signal handler.  This fixes the race
conditions that I mentioned earlier.  Basically, the point of the pipe
is to force the select() call to return immediately if a signal handler
fired before we actually started the select() call.  This then lets us
run the appropriate code based on flags set in the signal handler proper.
b) I added a number of flags to coalesce calls to common routines.  This
should make things slightly more efficient.
c) since most calls will tend to come in with a sequence number larger
than what has been received, I switched msg_queue_insert() to scan the
msg_list backwards to improve performance.

 filename="udevd.diff"
2005-04-26 21:35:13 -07:00
kay.sievers@vrfy.org
4a539daf1e [PATCH] dev_d.c file sorting and cleanup
On Thu, Mar 25, 2004 at 02:52:13AM +0100, Kay Sievers wrote:
> Please have look if it still works for you, I only did a very quick
> test.

Here is a unified version, with all the functions moved to udev_lib.c.
We have a generic function now, to call a given fnct(char *) for every
file ending with a specific suffix, sorted in lexical order. We use it
to execute the dev.d/ files and read our rules.d/ files. The binary
should be a bit smaller now.

I've also changed it, to not do the dev.d/ exec for net devices.
2005-04-26 21:35:12 -07:00
kay.sievers@vrfy.org
c81b35c08b [PATCH] replace fgets() with mmap() and introduce udev_lib.[hc]
Here we replace the various fgets() with a mmap() call for the config
file reading, due to the reported performance problems with klibc.

Thanks to Patrick's testing, it makes a very small, close to nothing
speed gain for libc users, but a 6 times speed increase for klibc users
with a 1000 line config file.

I've created a udev_lib.[hc] for this and also moved all the generic
stuff from udev.h in there and uninlined the functions.
2005-04-26 21:35:10 -07:00
kay.sievers@vrfy.org
d00bd1724b [PATCH] overall trivial trivial cleanup
Here I try to make the style a bit more consistant in the different
files, so that new patches just copy the 'right' one :)

Some "magic" numbers are replaced and udevtest.c is catched up with udev.
2005-04-26 21:35:08 -07:00