Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 237874 - udev-128: 'udevadm control --reload-rules' not working
Summary: udev-128: 'udevadm control --reload-rules' not working
Status: RESOLVED INVALID
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: [OLD] Core system (show other bugs)
Hardware: AMD64 Linux
: High normal (vote)
Assignee: udev maintainers
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-09-16 20:32 UTC by mjbjr
Modified: 2008-11-19 19:53 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mjbjr 2008-09-16 20:32:48 UTC
Linux localhost 2.6.25-gentoo-r4 #1 SMP Thu Jun 12 18:13:51 PDT 2008 x86_64 Intel(R) Core(TM)2 CPU 6700 @ 2.66GHz GenuineIntel GNU/Linux
udev-128 with hal-0.5.11-r3 and revdep-rebuild and reemerge of hal

I added a couple of hard drives and used the same rule "formula" as drives that
showup, but the new drives don't show up.  I turn on debugging with
'udevadm control --log-priority=debug' and even enter rule formatting errors in
my udev config file, '/etc/udev/rules.d/10-mjbjr-udev.rules', but get no errors
or new drives, old drives show up.

It seemed to me that it just wasn't reloading the rules.

Here's a older line from my config that works (from pre-udev-128,
machine has not been rebooted).  Drive was mounted (pre udev-128)
and '/dev/jabba', '/dev/jabba1', and '/dev/jabba2' correctly exist,
and drive works properly:
BUS=="scsi", SYSFS{model}=="ST3200826AS", SYSFS{vendor}=="ATA", NAME="%k", SYMLINK="jabba%n", MODE="0774"

Here's a line for a new drive that doesn't seem to be recognized,
i.e., '/dev/greenst' doesn't exist, drive mounted manually and works:
BUS=="scsi", SYSFS{vendor}=="ATA", SYSFS{model}=="WDC WD5000AACS-0", NAME="%k", SYMLINK="greenst%n", MODE="0774"

Here's a line from my config that doesn't work for a new drive.
This is my "control", it doesn't auto-mount and I haven't mounted it.
It has been partitioned and formatted:
BUS=="scsi"SYSFS{vendor"}="ATA", SYSFS{model}="ST3500320AS", NAME="%k, SYMLINK="roscoe%n"

If I add 'PROGRAM="beep" ('beep' makes a beep tone and runs correctly
when run by root) to the end of one of the above lines, I expect to
hear a beep when I run:

'udevadm control --reload-rules'

but I don't hear it.  Which among other things leads me to believe that
'udevadm control --reload-rules' is not working properly,
hence the 'strace', below.

Running 'strace udevadm control --reload-rules' seems to show it opening up
only the main config file, as far as I can tell:

# strace udevadm control --reload-rules
execve("/sbin/udevadm", ["udevadm", "control", "--reload-rules"], [/* 64 vars */]) = 0
brk(0)                                  = 0x516000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f76ef6ea000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f76ef6e9000
access("/etc/ld.so.preload", R_OK)      = -1 ENOENT (No such file or directory)
open("/etc/ld.so.cache", O_RDONLY)      = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=156628, ...}) = 0
mmap(NULL, 156628, PROT_READ, MAP_PRIVATE, 3, 0) = 0x7f76ef6c2000
close(3)                                = 0
open("/lib/libc.so.6", O_RDONLY)        = 3
read(3, "\177ELF\2\1\1\0\0\0\0\0\0\0\0\0\3\0>\0\1\0\0\0002\326\1\0\0\0\0\0@"..., 832) = 832
fstat(3, {st_mode=S_IFREG|0755, st_size=1273512, ...}) = 0
mmap(NULL, 2330808, PROT_READ|PROT_EXEC, MAP_PRIVATE|MAP_DENYWRITE, 3, 0) = 0x7f76ef397000
mprotect(0x7f76ef4c7000, 1048576, PROT_NONE) = 0
mmap(0x7f76ef5c7000, 20480, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_DENYWRITE, 3, 0x130000) = 0x7f76ef5c7000
mmap(0x7f76ef5cc000, 16568, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_FIXED|MAP_ANONYMOUS, -1, 0) = 0x7f76ef5cc000
close(3)                                = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f76ef6c1000
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f76ef6c0000
arch_prctl(ARCH_SET_FS, 0x7f76ef6c06f0) = 0
mprotect(0x7f76ef5c7000, 12288, PROT_READ) = 0
mprotect(0x7f76ef6eb000, 4096, PROT_READ) = 0
munmap(0x7f76ef6c2000, 156628)          = 0
brk(0)                                  = 0x516000
brk(0x537000)                           = 0x537000
open("/etc/udev/udev.conf", O_RDONLY)   = 3
fstat(3, {st_mode=S_IFREG|0644, st_size=277, ...}) = 0
mmap(NULL, 4096, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0) = 0x7f76ef6e8000
read(3, "# The initial syslog(3) priority:"..., 4096) = 277
read(3, ""..., 4096)                    = 0
close(3)                                = 0
munmap(0x7f76ef6e8000, 4096)            = 0
getuid()                                = 0
socket(PF_FILE, SOCK_DGRAM, 0)          = 3
sendto(3, "udevd-128\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\4"..., 292, 0, {sa_family=AF_FILE, path=@"/org/kernel/udev/udevd"...}, 25) = 292
close(3)                                = 0
exit_group(0)                           = ?


Reproducible: Always

Actual Results:  
'/dev/jabba', '/dev/jabba1', '/dev/jabba2'  show up

Expected Results:  
I should see the following devices:

'/dev/jabba', '/dev/jabba1', '/dev/jabba2'
'/dev/greenst', '/dev/greenst1'
'/dev/roscoe'. '/dev/roscoe1'


# emerge --info
Portage 2.2_rc8 (default-linux/amd64/2007.0, gcc-4.1.2, glibc-2.6-r0, 2.6.25-gentoo-r4 x86_64)
=================================================================
System uname: Linux-2.6.25-gentoo-r4-x86_64-Intel-R-_Core-TM-2_CPU_6700_@_2.66GHz-with-glibc2.2.5
Timestamp of tree: Tue, 16 Sep 2008 19:30:01 +0000
app-shells/bash:     3.2_p39
dev-java/java-config: 1.3.7, 2.0.33-r1
dev-lang/python:     2.4.4-r4, 2.5.2-r7
dev-python/pycrypto: 2.0.1-r6
sys-apps/baselayout: 1.12.10-r4
sys-apps/sandbox:    1.2.18.1-r2
sys-devel/autoconf:  2.13, 2.61
sys-devel/automake:  1.4_p6, 1.5, 1.6.3, 1.7.9-r1, 1.8.5-r3, 1.9.6-r2, 1.10.1-r1
sys-devel/binutils:  2.17
sys-devel/gcc-config: 1.3.16
sys-devel/libtool:   1.5.26
virtual/os-headers:  2.6.21
ACCEPT_KEYWORDS="amd64 ~amd64"
CBUILD="x86_64-pc-linux-gnu"
CFLAGS="-march=nocona -O2 -pipe"
CHOST="x86_64-pc-linux-gnu"
CONFIG_PROTECT="/etc /usr/kde/3.5/env /usr/kde/3.5/share/config /usr/kde/3.5/shutdown /usr/share/config"
CONFIG_PROTECT_MASK="/etc/env.d /etc/env.d/java/ /etc/fonts/fonts.conf /etc/gconf /etc/revdep-rebuild /etc/terminfo /etc/texmf/web2c /etc/udev/rules.d"
CXXFLAGS="-march=nocona -O2 -pipe"
DISTDIR="/usr/portage/distfiles"
FEATURES="distlocks parallel-fetch preserve-libs sandbox sfperms strict unmerge-orphans userfetch"
GENTOO_MIRRORS="http://www.gtlib.gatech.edu/pub/gentoo/ http://distfiles.gentoo.org http://www.ibiblio.org/pub/Linux/distributions/gentoo"
LANG="en_US.UTF-8"
LDFLAGS=""
MAKEOPTS="-j4"
PKGDIR="/usr/portage/packages"
PORTAGE_RSYNC_OPTS="--recursive --links --safe-links --perms --times --compress --force --whole-file --delete --stats --timeout=180 --exclude=/distfiles --exclude=/local --exclude=/packages"
PORTAGE_TMPDIR="/var/tmp"
PORTDIR="/usr/portage"
SYNC="rsync://rsync.gentoo.org/gentoo-portage"
USE="Tkinter X a52 aac accessibility acl acpi alsa amd64 apache2 apm bash-completion berkdb cdparanoia cli cracklib crypt cups dbus dri dts dv dvb dvd dvdr dvdread enblend encode exif ffmpeg firefox fortran gdbm gif gimp glx gmp gphoto gpm gps gstreamer gtk hal iconv ieee1394 ipv6 isdnlog java jpeg libnotify lm_sensors midi mime mmx mng mp3 mpeg mplayer mudflap ncurses nls nptl nptlonly nsplugin odbc ogg opengl openmp pam pcre pda pdf perl png postgres pppd pulseaudio python qt3support quicktime readline reflection rtsp ruby sdl session sift spl srt sse sse2 ssl svg tcpd tiff truetype unicode usb v4l vorbis wavpack wxwindows xcomposite xine xml xorg xosd xpm xulrunner xv xvid zlib" ALSA_CARDS="hda-intel emu10k" ALSA_PCM_PLUGINS="adpcm alaw asym copy dmix dshare dsnoop empty extplug file hooks iec958 ioplug ladspa lfloat linear meter mmap_emul mulaw multi null plug rate route share shm softvol" APACHE2_MODULES="actions alias auth_basic authn_alias authn_anon authn_dbm authn_default authn_file authz_dbm authz_default authz_groupfile authz_host authz_owner authz_user autoindex cache dav dav_fs dav_lock deflate dir disk_cache env expires ext_filter file_cache filter headers include info log_config logio mem_cache mime mime_magic negotiation rewrite setenvif speling status unique_id userdir usertrack vhost_alias" ELIBC="glibc" INPUT_DEVICES="keyboard mouse evdev" KERNEL="linux" LCD_DEVICES="bayrad cfontz cfontz633 glk hd44780 lb216 lcdm001 mtxorb ncurses text" USERLAND="GNU" VIDEO_CARDS="nvidia"
Unset:  CPPFLAGS, CTARGET, EMERGE_DEFAULT_OPTS, FFLAGS, INSTALL_MASK, LC_ALL, LINGUAS, PORTAGE_COMPRESS, PORTAGE_COMPRESS_FLAGS, PORTAGE_RSYNC_EXTRA_OPTS, PORTDIR_OVERLAY
Comment 1 Matthias Schwarzott gentoo-dev 2008-10-07 20:37:29 UTC
Ignoring all the text about specific rules, as this bug is about udevadm control.

udevadm control --reload-rules
does just what it tells: It reloads the rules into udevd.
It does NOT re-process the devices!

To do this you can issue
udevadm trigger
Comment 2 Matthias Schwarzott gentoo-dev 2008-11-19 19:53:03 UTC
Your rules can be improved:
1. Setting NAME="%k" is not needed, as this is default.
2. Setting MODE="0774" - for what do you need execute permissions on the dev-node ?
3. You overwrite all symlinks that are there before. Please use SYMLINK+=
4. BUS is deprecated, please use SUBSYSTEM


Otherwise closing this bug, as udev is doing fine.
udevadm trigger isn what you want.