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

1761 Commits

Author SHA1 Message Date
Kay Sievers
3f9f8de4de bring std(in|out|err) fd's in a sane state
If the kernel forks us as an usermodhelper, we don't have any of
the standard fd's and the first open() will start with fd=0.
This is inherited to all forked childs and confuses later forked
helpers where we want to read from a pipe connected to the helpers
stdout/stderr.

  # ls -l /proc/$(pidof udevd)/fd
  total 6
  dr-x------  2 root root  0 2005-08-18 12:44 .
  dr-xr-xr-x  4 root root  0 2005-08-18 12:44 ..
  lrwx------  1 root root 64 2005-08-18 12:44 0 -> /dev/null
  lrwx------  1 root root 64 2005-08-18 12:44 1 -> socket:[1274617]
  lr-x------  1 root root 64 2005-08-18 12:44 2 -> pipe:[1274618]
  l-wx------  1 root root 64 2005-08-18 12:44 3 -> pipe:[1274618]
  lrwx------  1 root root 64 2005-08-18 12:44 4 -> socket:[1274619]
  lrwx------  1 root root 64 2005-08-18 12:44 5 -> socket:[1274620]

Ouch! This will obviously not redirect sterr, it will kill the pipe
we established between the parent and the child:

  devnull = open("/dev/null", O_RDWR);
  dup2(devnull, STDERR_FILENO);

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-18 13:07:15 +02:00
Kay Sievers
e331c54dc5 fix typo in cdrom_id syslog
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-18 04:54:59 +02:00
Kay Sievers
5097a6ca42 Merge rsync://rsync.kernel.org/pub/scm/linux/hotplug/udev 2005-08-18 04:48:43 +02:00
Greg Kroah-Hartman
a961dcbf0d cdrom_id: change err() to info() to help with debugging problems
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-17 16:10:32 -07:00
Greg Kroah-Hartman
fc046d4d08 Always open the cdrom drive in non-blocking mode in cdrom_id
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-17 16:09:03 -07:00
Kay Sievers
f7a144a5be vol_id: fix sloppy error handling
vol_id segfaults if read() fails on broken devices reporting
the wrong size.

Thanks to Erhard Schultchen for the debugging.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-17 16:58:19 +02:00
Kay Sievers
5618b5611b ENV{TEST}=="1" compares and ENV{TEST}="1" sets the environment
This can be uses to export stuff to the event environment or
to carry a state from one rule to another, like enabling/disabling
later rules conditionally.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-16 04:25:20 +02:00
Kay Sievers
beb9f9ccb8 move udevmonitor to /usr/sbin
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-15 12:00:43 +02:00
Kay Sievers
40caaeec51 cleanup some debug output and move to info level + unify select() loops
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-15 11:57:04 +02:00
Greg Kroah-Hartman
8aafc06d94 067 release 2005-08-13 10:10:50 -07:00
Kay Sievers
af5461f72f don't fail too bad, if /dev/null does not exist
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-13 02:36:12 +02:00
Kay Sievers
7d38d2287c fix udevstart event ordering, we want /dev/null very early 2005-08-13 02:19:22 +02:00
Kay Sievers
b5d88a0cfe Merge rsync://rsync.kernel.org/pub/scm/linux/hotplug/udev 2005-08-13 02:16:54 +02:00
Kay Sievers
853ccc433c fix more compiler warnings ...
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-13 00:18:44 +02:00
Greg Kroah-Hartman
903a36495f added the cdrom.h #defines directly into the cdrom_id.c file
This solves the problem with building the file against old kernel header
files.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-12 11:37:56 -07:00
Kay Sievers
d2e8d41b9c fix make install, as we don't provide a default rule set anymore
Several people complained about the "default" rules and the "default"
setup. Here we start to remove things where we can't hava a  "default".
The best examples for rules are in the distro folders, just pick the one
that matches your needs and start from there.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-12 02:07:50 +02:00
Kay Sievers
5590ace308 update SUSE rules
don't use ID_TYPE, so cdroms will be in /dev/disk/

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-12 00:50:48 +02:00
Greg KH
f5bed72a53 066 release 2005-08-11 15:44:08 -07:00
Greg KH
a3f47f6319 tweak the gentoo rules some more.
- make the persistant rules smaller
	- add usbfs-like device node support

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-11 15:32:14 -07:00
Greg KH
91a8b53159 changed location of gentoo helper apps to be /sbin instead of in scripts dir
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-11 15:10:10 -07:00
Greg KH
55ac5dad09 Change the gentoo rules to use cdrom_id instead of cdsymlink.sh
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-11 15:08:08 -07:00
Greg KH
5a64cea1e1 fix klibc build issue in cdrom_id.c
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-11 14:38:33 -07:00
Greg KH
c1986ea33c added cdrom_id to the build check 2005-08-11 14:37:54 -07:00
Greg KH
8ee99e3279 changed cdrom_id exports to be easier to understand and consistant with other _id programs.
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-11 14:04:24 -07:00
Greg KH
8f6919e639 Created cdrom_id program to make it easier to determine cdrom types
Based on the framework from ata_id by Kay.
Now we can drop the cdsymlinks.sh and .c files

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-11 13:59:21 -07:00
Greg KH
02a9a08fb7 update gentoo rule file.
This fixes the issue of cdroms not showing up in the proper group,
and them showing up in /dev/cd/ for the persistant names.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-11 13:02:44 -07:00
Kay Sievers
4937afa402 move some logging to the info level
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-11 21:01:46 +02:00
Kay Sievers
2b996ad193 add Usage: to udevmonitor and udevcontrol
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-11 20:34:24 +02:00
Kay Sievers
27f877e60f allow logging of all output from executed tools
If USE_DEBUG=true and udev_log="debug", all output of the forked
programs to stdout and stderr is send to syslog.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-11 17:32:59 +02:00
Kay Sievers
7fd0de4984 update SUSE rules
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-11 17:19:05 +02:00
Thierry Vignaud
a1ea706a1e fix udevinfo output 2005-08-10 17:06:01 +02:00
Kay Sievers
59d6bfefce split udev_util in several files
It too big for the small tools to link against for only the log function.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-10 16:54:14 +02:00
Kay Sievers
d33c51c245 update SUSE rules
Tape naming is harder than expected, go back to block devices only.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-10 15:27:25 +02:00
Kay Sievers
d47fd445bd trivial text cleanups
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-09 22:11:44 +02:00
Kay Sievers
a37610d0f8 remove example rules and put the dev.d stuff into the run_directory folder
The distro rules are the best example you can get and the use of
dev.d/ is no longer recommended.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-09 20:11:26 +02:00
Kay Sievers
34c00c915c update README
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-09 19:45:08 +02:00
Kay Sievers
6214290df5 more distro rules updates
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-09 19:17:25 +02:00
Kay Sievers
bebbc31b90 add firmware_helper to load firmware
From: Bill Nottingham <notting@redhat.com>

Changed reading of firmware blob to mmap and let firmware_helper
follow the setting of the log level with UDEV_LOG.
2005-08-09 19:00:37 +02:00
Kay Sievers
1bcac4e483 update SUSE rules
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-09 15:53:17 +02:00
Kay Sievers
80489e6395 add SUSE rules
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-09 12:29:12 +02:00
Kay Sievers
b7299fd904 update distro rules files
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-09 11:58:11 +02:00
Kay Sievers
bfd1294892 add flag for reading of precompiled rules
Rules can be precompiled and stored on disk for initramfs, to avoid
parsing the rules with every event again and again. Also the OWNER and
GROUP names are already resolved to numerical values in the compiled
rules. This flag is used for the upcoming move of the rules parsing
into udevd:
  If the real root is mounted udevd is started and parses the rules
  only once. The event processes will inherit the already parsed rules
  from the daemon, so we want to ignore any precompiled rules and
  use the real rules files and watch the filesystem for changes to
  reload the rules automatically.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-08 17:43:42 +02:00
Kay Sievers
63cc8f0491 allow clean shutdown of udevd
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-08 05:07:36 +02:00
Kay Sievers
13d11705bf switch some strlcpy's to memcpy
strlcpy counts the sourec string lengt and is therefore not suitable
to copy a defined length of characters from one string to another.

Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-08 02:21:55 +02:00
Kay Sievers
738428b449 read sysfs attribute also from parent class device
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-05 01:52:57 +02:00
Greg KH
52dbd80e78 updated gentoo rule file to handle removable ide devices.
Thanks to Kay for the quick fix.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-04 16:33:53 -07:00
Kay Sievers
47e353f9b9 add NETLINK define for the lazy distros
Signed-off-by: Kay Sievers <kay.sievers@suse.de>
2005-08-04 12:24:41 +02:00
Greg Kroah-Hartman
cfb7ac2b5b 065 release 2005-08-02 13:56:41 -07:00
Greg Kroah-Hartman
c5e6eaa002 Merge gregkh@ehlo.org:/home/kay/public_html/pub/scm/linux/hotplug/udev-kay 2005-08-02 13:07:30 -07:00
Greg Kroah-Hartman
74f1ce92c4 Added persistent name rules for block devices to gentoo rule file.
Copied from Kay's rules from the SuSE package.

Let the fun begin...

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-08-02 12:28:50 -07:00