[SOLVED] udev rule no longer working
I have a udev rule set up to automatically mount an ext4 filesystem when I plug a certain thumb drive in. It was working fine until yesterday (probably due to updates). Here is the rule, in file /etc/udev/rules.d/99-gfk.rules:
KERNEL=="sd?2", SUBSYSTEM=="block", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="6545", ATTRS{serial}=="1C6F654E4041ED601910053F", SYMLINK+="gfshare"
ACTION=="add", KERNEL=="sd?2", SUBSYSTEM=="block", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="6545", ATTRS{serial}=="1C6F654E4041ED601910053F", RUN+="/bin/mkdir /media/gfshare"
ACTION=="add", KERNEL=="sd?2", SUBSYSTEM=="block", ATTRS{idVendor}=="0930", ATTRS{idProduct}=="6545", ATTRS{serial}=="1C6F654E4041ED601910053F", RUN+="/bin/mount -t ext4 -o ro,nosuid,nodev,noexec,noatime /dev/gfshare /media/gfshare"
The symlink and the mkdir command are both working fine, but the mount command is not being run for some reason. If I manually run the mount command it works fine. Some possibly helpful output:
# pacman -Qo $(which udevadm)
/usr/bin/udevadm is owned by systemd 212-1
# dmesg |tail -16
[26458.120628] usb 7-1.3: new high-speed USB device number 7 using ehci-pci
[26458.223059] usb-storage 7-1.3:1.0: USB Mass Storage device detected
[26458.223825] scsi10 : usb-storage 7-1.3:1.0
[26459.311607] scsi 10:0:0:0: Direct-Access Kingston DataTraveler 2.0 PMAP PQ: 0 ANSI: 4
[26460.834081] sd 10:0:0:0: [sdd] 15240576 512-byte logical blocks: (7.80 GB/7.26 GiB)
[26460.834931] sd 10:0:0:0: [sdd] Write Protect is off
[26460.834935] sd 10:0:0:0: [sdd] Mode Sense: 23 00 00 00
[26460.835617] sd 10:0:0:0: [sdd] No Caching mode page found
[26460.835621] sd 10:0:0:0: [sdd] Assuming drive cache: write through
[26460.839455] sd 10:0:0:0: [sdd] No Caching mode page found
[26460.839460] sd 10:0:0:0: [sdd] Assuming drive cache: write through
[26460.860579] sdd: sdd1 sdd2
[26460.867111] sd 10:0:0:0: [sdd] No Caching mode page found
[26460.867115] sd 10:0:0:0: [sdd] Assuming drive cache: write through
[26460.867118] sd 10:0:0:0: [sdd] Attached SCSI removable disk
[26461.041982] EXT4-fs (sdd2): mounted filesystem with ordered data mode. Opts: (null)
# udevadm test /sys/bus/usb/devices/7-1.3
calling: test
version 212
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
load module index
timestamp of '/etc/systemd/network' changed
timestamp of '/usr/lib/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Created link configuration context
timestamp of '/etc/udev/rules.d' changed
Skipping overridden file: /usr/lib/udev/rules.d/80-net-setup-link.rules.
read rules file: /usr/lib/udev/rules.d/10-dm.rules
read rules file: /usr/lib/udev/rules.d/11-dm-lvm.rules
read rules file: /etc/udev/rules.d/12-android.rules
read rules file: /usr/lib/udev/rules.d/13-dm-disk.rules
read rules file: /usr/lib/udev/rules.d/40-hpet-permissions.rules
read rules file: /usr/lib/udev/rules.d/40-usb-media-players.rules
read rules file: /usr/lib/udev/rules.d/42-usb-hid-pm.rules
read rules file: /usr/lib/udev/rules.d/50-firmware.rules
read rules file: /usr/lib/udev/rules.d/50-udev-default.rules
read rules file: /usr/lib/udev/rules.d/51-android.rules
read rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
read rules file: /usr/lib/udev/rules.d/60-drm.rules
read rules file: /usr/lib/udev/rules.d/60-keyboard.rules
read rules file: /usr/lib/udev/rules.d/60-pcmcia.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-serial.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
read rules file: /usr/lib/udev/rules.d/60-vboxdrv.rules
read rules file: /usr/lib/udev/rules.d/61-accelerometer.rules
read rules file: /usr/lib/udev/rules.d/63-md-raid-arrays.rules
read rules file: /usr/lib/udev/rules.d/64-btrfs.rules
read rules file: /usr/lib/udev/rules.d/64-md-raid-assembly.rules
read rules file: /usr/lib/udev/rules.d/69-cd-sensors.rules
read rules file: /usr/lib/udev/rules.d/69-dm-lvm-metad.rules
read rules file: /usr/lib/udev/rules.d/69-libmtp.rules
read rules file: /usr/lib/udev/rules.d/70-infrared.rules
read rules file: /usr/lib/udev/rules.d/70-power-switch.rules
read rules file: /usr/lib/udev/rules.d/70-uaccess.rules
read rules file: /usr/lib/udev/rules.d/71-seat.rules
read rules file: /usr/lib/udev/rules.d/73-seat-late.rules
read rules file: /usr/lib/udev/rules.d/75-net-description.rules
read rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
read rules file: /usr/lib/udev/rules.d/75-tty-description.rules
read rules file: /usr/lib/udev/rules.d/78-sound-card.rules
read rules file: /usr/lib/udev/rules.d/80-drivers.rules
read rules file: /etc/udev/rules.d/80-net-setup-link.rules
read rules file: /usr/lib/udev/rules.d/80-udisks.rules
read rules file: /usr/lib/udev/rules.d/80-udisks2.rules
read rules file: /usr/lib/udev/rules.d/85-usbmuxd.rules
read rules file: /usr/lib/udev/rules.d/90-alsa-restore.rules
read rules file: /usr/lib/udev/rules.d/95-cd-devices.rules
read rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
read rules file: /usr/lib/udev/rules.d/95-udev-late.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-dell.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-fujitsu.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-gateway.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-ibm.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-lenovo.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-toshiba.rules
read rules file: /usr/lib/udev/rules.d/95-upower-csr.rules
read rules file: /usr/lib/udev/rules.d/95-upower-hid.rules
read rules file: /usr/lib/udev/rules.d/95-upower-wup.rules
read rules file: /etc/udev/rules.d/99-gfk.rules
read rules file: /usr/lib/udev/rules.d/99-systemd.rules
read rules file: /usr/lib/udev/rules.d/kino.rules
rules contain 98304 bytes tokens (8192 * 12 bytes), 22360 bytes strings
10092 strings (88570 bytes), 8317 de-duplicated (67986 bytes), 1776 trie nodes used
IMPORT builtin 'usb_id' /usr/lib/udev/rules.d/50-udev-default.rules:9
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/50-udev-default.rules:9
MODE 0664 /usr/lib/udev/rules.d/50-udev-default.rules:37
GROUP 1002 /usr/lib/udev/rules.d/51-android.rules:387
MODE 0660 /usr/lib/udev/rules.d/51-android.rules:387
RUN '/usr/share/virtualbox/VBoxCreateUSBNode.sh $major $minor $attr{bDeviceClass} vboxusers' /usr/lib/udev/rules.d/60-vboxdrv.rules:6
PROGRAM '/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7' /usr/lib/udev/rules.d/69-libmtp.rules:1204
starting '/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7'
'/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7'(out) '0'
'/usr/lib/udev/mtp-probe /sys/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3 7 7' [24644] exit with return code 0
IMPORT builtin 'path_id' /usr/lib/udev/rules.d/71-seat.rules:43
RUN 'uaccess' /usr/lib/udev/rules.d/73-seat-late.rules:15
handling device node '/dev/bus/usb/007/007', devnum=c189:774, mode=0660, uid=0, gid=1002
preserve permissions /dev/bus/usb/007/007, 020660, uid=0, gid=1002
preserve already existing symlink '/dev/char/189:774' to '../bus/usb/007/007'
ACTION=add
BUSNUM=007
DEVNAME=/dev/bus/usb/007/007
DEVNUM=007
DEVPATH=/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3
DEVTYPE=usb_device
DRIVER=usb
ID_BUS=usb
ID_DRIVE_THUMB=1
ID_FOR_SEAT=usb-pci-0000_00_1a_7-usb-0_1_3
ID_MODEL=DataTraveler_2.0
ID_MODEL_ENC=DataTraveler\x202.0
ID_MODEL_FROM_DATABASE=Kingston DataTraveler 102 Flash Drive / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
ID_MODEL_ID=6545
ID_PATH=pci-0000:00:1a.7-usb-0:1.3
ID_PATH_TAG=pci-0000_00_1a_7-usb-0_1_3
ID_REVISION=0100
ID_SERIAL=Kingston_DataTraveler_2.0_1C6F654E4041ED601910053F
ID_SERIAL_SHORT=1C6F654E4041ED601910053F
ID_USB_INTERFACES=:080650:
ID_VENDOR=Kingston
ID_VENDOR_ENC=Kingston
ID_VENDOR_FROM_DATABASE=Toshiba Corp.
ID_VENDOR_ID=0930
MAJOR=189
MINOR=774
PRODUCT=930/6545/100
SUBSYSTEM=usb
TAGS=:seat:uaccess:
TYPE=0/0/0
USEC_INITIALIZED=26452326568
adb_user=yes
run: '/usr/share/virtualbox/VBoxCreateUSBNode.sh 189 774 00 vboxusers'
run: 'uaccess'
unload module index
Unloaded link configuration context
# udevadm test /sys/bus/usb/devices/7-1.3:1.0
calling: test
version 212
This program is for debugging only, it does not run any program
specified by a RUN key. It may show incorrect results, because
some values may be different, or not available at a simulation run.
load module index
timestamp of '/etc/systemd/network' changed
timestamp of '/usr/lib/systemd/network' changed
Parsed configuration file /usr/lib/systemd/network/99-default.link
Created link configuration context
timestamp of '/etc/udev/rules.d' changed
Skipping overridden file: /usr/lib/udev/rules.d/80-net-setup-link.rules.
read rules file: /usr/lib/udev/rules.d/10-dm.rules
read rules file: /usr/lib/udev/rules.d/11-dm-lvm.rules
read rules file: /etc/udev/rules.d/12-android.rules
read rules file: /usr/lib/udev/rules.d/13-dm-disk.rules
read rules file: /usr/lib/udev/rules.d/40-hpet-permissions.rules
read rules file: /usr/lib/udev/rules.d/40-usb-media-players.rules
read rules file: /usr/lib/udev/rules.d/42-usb-hid-pm.rules
read rules file: /usr/lib/udev/rules.d/50-firmware.rules
read rules file: /usr/lib/udev/rules.d/50-udev-default.rules
read rules file: /usr/lib/udev/rules.d/51-android.rules
read rules file: /usr/lib/udev/rules.d/60-cdrom_id.rules
read rules file: /usr/lib/udev/rules.d/60-drm.rules
read rules file: /usr/lib/udev/rules.d/60-keyboard.rules
read rules file: /usr/lib/udev/rules.d/60-pcmcia.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-alsa.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-input.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-serial.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage-tape.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-storage.rules
read rules file: /usr/lib/udev/rules.d/60-persistent-v4l.rules
read rules file: /usr/lib/udev/rules.d/60-vboxdrv.rules
read rules file: /usr/lib/udev/rules.d/61-accelerometer.rules
read rules file: /usr/lib/udev/rules.d/63-md-raid-arrays.rules
read rules file: /usr/lib/udev/rules.d/64-btrfs.rules
read rules file: /usr/lib/udev/rules.d/64-md-raid-assembly.rules
read rules file: /usr/lib/udev/rules.d/69-cd-sensors.rules
read rules file: /usr/lib/udev/rules.d/69-dm-lvm-metad.rules
read rules file: /usr/lib/udev/rules.d/69-libmtp.rules
read rules file: /usr/lib/udev/rules.d/70-infrared.rules
read rules file: /usr/lib/udev/rules.d/70-power-switch.rules
read rules file: /usr/lib/udev/rules.d/70-uaccess.rules
read rules file: /usr/lib/udev/rules.d/71-seat.rules
read rules file: /usr/lib/udev/rules.d/73-seat-late.rules
read rules file: /usr/lib/udev/rules.d/75-net-description.rules
read rules file: /usr/lib/udev/rules.d/75-probe_mtd.rules
read rules file: /usr/lib/udev/rules.d/75-tty-description.rules
read rules file: /usr/lib/udev/rules.d/78-sound-card.rules
read rules file: /usr/lib/udev/rules.d/80-drivers.rules
read rules file: /etc/udev/rules.d/80-net-setup-link.rules
read rules file: /usr/lib/udev/rules.d/80-udisks.rules
read rules file: /usr/lib/udev/rules.d/80-udisks2.rules
read rules file: /usr/lib/udev/rules.d/85-usbmuxd.rules
read rules file: /usr/lib/udev/rules.d/90-alsa-restore.rules
read rules file: /usr/lib/udev/rules.d/95-cd-devices.rules
read rules file: /usr/lib/udev/rules.d/95-dm-notify.rules
read rules file: /usr/lib/udev/rules.d/95-udev-late.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-dell.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-fujitsu.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-gateway.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-ibm.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-lenovo.rules
read rules file: /usr/lib/udev/rules.d/95-upower-battery-recall-toshiba.rules
read rules file: /usr/lib/udev/rules.d/95-upower-csr.rules
read rules file: /usr/lib/udev/rules.d/95-upower-hid.rules
read rules file: /usr/lib/udev/rules.d/95-upower-wup.rules
read rules file: /etc/udev/rules.d/99-gfk.rules
read rules file: /usr/lib/udev/rules.d/99-systemd.rules
read rules file: /usr/lib/udev/rules.d/kino.rules
rules contain 98304 bytes tokens (8192 * 12 bytes), 22360 bytes strings
10092 strings (88570 bytes), 8317 de-duplicated (67986 bytes), 1776 trie nodes used
IMPORT builtin 'hwdb' /usr/lib/udev/rules.d/50-udev-default.rules:11
RUN 'kmod load $env{MODALIAS}' /usr/lib/udev/rules.d/80-drivers.rules:5
ACTION=add
DEVPATH=/devices/pci0000:00/0000:00:1a.7/usb7/7-1/7-1.3/7-1.3:1.0
DEVTYPE=usb_interface
DRIVER=usb-storage
ID_MODEL_FROM_DATABASE=Kingston DataTraveler 102 Flash Drive / HEMA Flash Drive 2 GB / PNY Attache 4GB Stick
ID_VENDOR_FROM_DATABASE=Toshiba Corp.
INTERFACE=8/6/80
MODALIAS=usb:v0930p6545d0100dc00dsc00dp00ic08isc06ip50in00
PRODUCT=930/6545/100
SUBSYSTEM=usb
TYPE=0/0/0
USEC_INITIALIZED=452326811
run: 'kmod load usb:v0930p6545d0100dc00dsc00dp00ic08isc06ip50in00'
unload module index
Unloaded link configuration context
Last edited by bentglasstube (2014-04-03 20:51:36)
I see. That is somewhat aggravating but I will find another way to achieve what I wanted I suppose.
Thank you. Should I mark this is solved or unsolvable or something? Sorry, I'm new to posting on these forums.
Edit: I was able to achieve what I wanted with udevil as recommended by the wiki.
Last edited by bentglasstube (2014-04-03 20:55:45)
Similar Messages
-
[Solved] udev rule not working
Hi!
I'm trying to set my trackpoint sensitivity and speed using an udev rule:
[jeroen@zechs ~]$ ls -l /etc/udev/rules.d/
total 4
-rw-r--r-- 1 root root 113 Sep 14 01:54 10-trackpoint.rules
[jeroen@zechs ~]$ cat /etc/udev/rules.d/10-trackpoint.rules
# Set trackpoint option
KERNEL=="serio2", ATTR{speed}="180", ATTR{sensitivity}="255", RUN+="touch /tmp/udevtest"
When I test the rule, everything seems to be working as planned:
[jeroen@zechs ~]$ cat /sys/devices/platform/i8042/serio1/serio2/speed
97
[jeroen@zechs ~]$ cat /sys/devices/platform/i8042/serio1/serio2/sensitivity
128
[jeroen@zechs ~]$ sudo udevadm test /sys/devices/platform/i8042/serio1/serio2/
calling: test
version 216
timestamp of '/etc/udev/rules.d' changed
Reading rules file: /etc/udev/rules.d/10-trackpoint.rules
ATTR '/sys/devices/platform/i8042/serio1/serio2/speed' writing '180' /etc/udev/rules.d/10-trackpoint.rules:2
ATTR '/sys/devices/platform/i8042/serio1/serio2/sensitivity' writing '255' /etc/udev/rules.d/10-trackpoint.rules:2
RUN 'touch /tmp/udevtest' /etc/udev/rules.d/10-trackpoint.rules:2
ACTION=add
DEVPATH=/devices/platform/i8042/serio1/serio2
DRIVER=psmouse
MODALIAS=serio:ty05pr00id00ex00
SERIO_EXTRA=00
SERIO_ID=00
SERIO_PROTO=00
SERIO_TYPE=05
SUBSYSTEM=serio
USEC_INITIALIZED=284056746
run: 'touch /tmp/udevtest'
run: 'kmod load serio:ty05pr00id00ex00'
unload module index
Unloaded link configuration context.
[jeroen@zechs ~]$ cat /sys/devices/platform/i8042/serio1/serio2/sensitivity
255
[jeroen@zechs ~]$ cat /sys/devices/platform/i8042/serio1/serio2/speed
180
But when I boot the system, the rule has not been applied
[BOOT]
[jeroen@zechs ~]$ cat /sys/devices/platform/i8042/serio1/serio2/speed
97
[jeroen@zechs ~]$ cat /sys/devices/platform/i8042/serio1/serio2/sensitivity
128
[jeroen@zechs ~]$ sudo udevadm trigger
[jeroen@zechs ~]$ ls -l /tmp/udevtest
ls: cannot access /tmp/udevtest: No such file or directory
So the rule runs fine when I do `udevadm test` but fails to run on boot or `udevadm trigger`
Any hints or ideas, or probably some basic stuff I missed, to get this working?
Thank you for reading this far!
Last edited by jeroentbt (2014-10-07 11:42:58)There is not much to go with.
I'll try adding the 'description' attribute maybe.
$ udevadm info -a -p /sys/devices/platform/i8042/serio1/serio2
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/platform/i8042/serio1/serio2':
KERNEL=="serio2"
SUBSYSTEM=="serio"
DRIVER=="psmouse"
ATTR{resolution}=="200"
ATTR{rate}=="100"
ATTR{bind_mode}=="auto"
ATTR{resync_time}=="0"
ATTR{jenks}=="135"
ATTR{reach}=="10"
ATTR{speed}=="180"
ATTR{ztime}=="38"
ATTR{draghys}=="255"
ATTR{description}=="Synaptics pass-through"
ATTR{mindrag}=="20"
ATTR{ext_dev}=="1"
ATTR{skipback}=="0"
ATTR{upthresh}=="255"
ATTR{resetafter}=="5"
ATTR{thresh}=="8"
ATTR{protocol}=="TPPS/2"
ATTR{press_to_select}=="0"
ATTR{sensitivity}=="255"
ATTR{inertia}=="6"
ATTR{firmware_id}==""
looking at parent device '/devices/platform/i8042/serio1':
KERNELS=="serio1"
SUBSYSTEMS=="serio"
DRIVERS=="psmouse"
ATTRS{resolution}=="200"
ATTRS{rate}=="80"
ATTRS{bind_mode}=="auto"
ATTRS{resync_time}=="0"
ATTRS{description}=="i8042 AUX port"
ATTRS{resetafter}=="5"
ATTRS{protocol}=="SynPS/2"
ATTRS{firmware_id}=="PNP: LEN0015 PNP0f13"
looking at parent device '/devices/platform/i8042':
KERNELS=="i8042"
SUBSYSTEMS=="platform"
DRIVERS=="i8042"
looking at parent device '/devices/platform':
KERNELS=="platform"
SUBSYSTEMS==""
DRIVERS==""
EDIT:
tried with these two rules, no dice:
KERNEL=="serio2", ATTR{description}=="Synaptics pass-through", ATTR{speed}="180", ATTR{sensitivity}="255", RUN+="touch /tmp/udevtest"
ATTR{description}=="Synaptics pass-through", ATTR{speed}="180", ATTR{sensitivity}="255", RUN+="touch /tmp/udevtest"
Last edited by jeroentbt (2014-09-14 21:23:33) -
Solved: Udev rules not working
I have file called "/etc/udev/rules.d/99-monitor-hotplug.rules" with this rule:
ACTION=="change", SUBSYSTEM=="drm", RUN+="/root/scripts/hotPlugMonitor.sh"
But hotPlugMonitor.sh-script is not ran even thought it has permission to be ran and
udevadm monitor --property
gives:
KERNEL[69983.904205] change /devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
MAJOR=226
MINOR=0
SEQNUM=1885
SUBSYSTEM=drm
UDEV [69983.905420] change /devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0 (drm)
ACTION=change
DEVNAME=/dev/dri/card0
DEVPATH=/devices/pci0000:00/0000:00:01.0/0000:01:00.0/drm/card0
DEVTYPE=drm_minor
HOTPLUG=1
ID_FOR_SEAT=drm-pci-0000_01_00_0
ID_PATH=pci-0000:01:00.0
ID_PATH_TAG=pci-0000_01_00_0
MAJOR=226
MINOR=0
SEQNUM=1885
SUBSYSTEM=drm
TAGS=:seat:uaccess:
USEC_INITIALIZED=6
when I detach my monitor.
Last edited by oilgame (2013-08-31 09:10:08)You got the command slightly wrong. See the right command:
udevadm control --reload
From:
$ udevadm control --help | grep reload
--reload reload rules and databases -
[SOLVED] udev rule launch graphical app
How can I make a udev rule launch a graphical application, like, for instance, feh?
I've tried creating a rule detects when a specific mass storage device is connected and executes a script (/root/.scripts/feh-camera.sh). The script exports DISPLAY and XAUTHORITY and everything seems to work.
However when I restarted a black screen appeared right after Loading Modules (that appears after Starting udev events). Removing the udev rule solved the problem, so I must be doing something wrong.
What's the right way of doing this?
Thanks in advance.
Last edited by Vieira (2010-05-06 22:38:49)Device was not connected at boot but I'll try what you suggested anyway. Thanks for your help.
EDIT:
It's solved. It turns out the underlying problem was that exporting DISPLAY breaks the udev environment. For future reference solved it with:
45-foobar.rules
ATTRS{product}=="DSLR-A330", ATTR{removable}=="1", ENV{REMOVE_CMD}="/bin/umount /media/camera", RUN+="/bin/mount <bla bla>", RUN+="/bin/su vieira -c '/etc/udev/rules.d/45-foobar.sh'"
and the script, where the problem was, must not export anything, just set inline, i.e.
#!/bin/sh
HOME=/home/vieira DISPLAY=:0 /usr/bin/feh -r /mnt/camera
Last edited by Vieira (2010-05-06 22:35:39) -
Recently (after the iCloud) my mail is full of garbage that had previously had rules applied. The rules are no longer working, even if applied manually. If anyone is having this problem or know of a solution please advise. Thank you in advance.
I just had the same problem after installing MtLion a few days ago. Went to Mail > Perferences > Accounts > Rules and rechecked the box for the Rules I had setup before the Upgrade/Update.
-
Mail rules no longer work.
Having trouble with Mail rules that I have used in the past - they no longer work. Any ideas? Running 10.4.10
Yes, the same thing has happened to me.
But I'd like to avoid having to set up the the rules again (if I trashing the com.apple.mail.plist. I have a lot of rules, and it would take some time to set them up again. Does anyone know of other options? -
[SOLVED] udev rules: cannot run command
I want to run a scipt everytime I plug in my external harddrive. I read the documentation and create a file called /etc/udev/rules.d/extern_hd.rules:
SUBSYSTEMS=="usb", SYSFS{serial}=="33504D315647585A", SYMLINK+="ExternHD", RUN+="/root/scripts/test.sh"
The symlink "ExternHD" gets created. The permissions of test.sh are rwxr-xr-x root root, but it never gets executed. What am I doing wrong?
Last edited by Kei (2007-09-18 11:30:35)Solution was easy... Udev doesn't want to start anything from within /root, so I put a hardlink to /usr/local/bin/ and now everything works fine.
-
[Solved] udev rules: serial for persistent device naming disappeared
Hello,
since the latest upgrade of udev and kmod I cant't mount my external e-SATA hard disk with my working udev rules.
This is my udev rule:
$ cat /etc/udev/rules.d/66-persistent_esata.rules
KERNEL=="sd?1", SUBSYSTEMS=="block", ENV{ID_SERIAL_SHORT}=="S1VSJ1LS301247", NAME="aluguard"
When plugged in, I could decrypt and mount it with "sudo cryptsetup luksOpen /dev/aluguard aluguard && mount /mnt/aluguard".
Since the update above I get "Device /dev/aluguard doesn't exist or access denied."
While I re-checked https://wiki.archlinux.org/index.php/Ma … _with_udev, I discovered, that the serial entry in the output of udevadm has vanished:
$ udevadm info -a -p $(udevadm info -q path -n /dev/sdg)
Udevadm info starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg':
KERNEL=="sdg"
SUBSYSTEM=="block"
DRIVER==""
ATTR{range}=="16"
ATTR{ext_range}=="256"
ATTR{removable}=="0"
ATTR{ro}=="0"
ATTR{size}=="1953525168"
ATTR{alignment_offset}=="0"
ATTR{discard_alignment}=="0"
ATTR{capability}=="50"
ATTR{stat}==" 96 24 762 780 0 0 0 0 0 780 780"
ATTR{inflight}==" 0 0"
ATTR{events}==""
ATTR{events_async}==""
ATTR{events_poll_msecs}=="-1"
looking at parent device '/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0':
KERNELS=="3:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{device_blocked}=="0"
ATTRS{type}=="0"
ATTRS{scsi_level}=="6"
ATTRS{vendor}=="ATA "
ATTRS{model}=="SAMSUNG HD103SI "
ATTRS{rev}=="1AG0"
ATTRS{state}=="running"
ATTRS{timeout}=="30"
ATTRS{iocounterbits}=="32"
ATTRS{iorequest_cnt}=="0xa2"
ATTRS{iodone_cnt}=="0x98"
ATTRS{ioerr_cnt}=="0xc"
ATTRS{evt_media_change}=="0"
ATTRS{queue_depth}=="31"
ATTRS{queue_ramp_up_period}=="120000"
ATTRS{queue_type}=="simple"
looking at parent device '/devices/pci0000:00/0000:00:09.0/host3/target3:0:0':
KERNELS=="target3:0:0"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:09.0/host3':
KERNELS=="host3"
SUBSYSTEMS=="scsi"
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:09.0':
KERNELS=="0000:00:09.0"
SUBSYSTEMS=="pci"
DRIVERS=="ahci"
ATTRS{vendor}=="0x10de"
ATTRS{device}=="0x0554"
ATTRS{subsystem_vendor}=="0x1849"
ATTRS{subsystem_device}=="0x0554"
ATTRS{class}=="0x010601"
ATTRS{irq}=="23"
ATTRS{local_cpus}=="00000000,00000003"
ATTRS{local_cpulist}=="0-1"
ATTRS{numa_node}=="0"
ATTRS{dma_mask_bits}=="64"
ATTRS{consistent_dma_mask_bits}=="64"
ATTRS{enable}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{msi_bus}==""
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
What is the reason for this strange behaviour, and how can I get back the serial entry?
Thank in advance!
Last edited by indianahorst (2012-01-31 13:03:20)$ udevadm info -q all -n /dev/sdg1
P: /devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg/sdg1
N: sdg1
S: disk/by-id/ata-SAMSUNG_HD103SI_S1VSJ1LS301247-part1
S: disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1LS301247-part1
S: disk/by-id/wwn-0x50024e900136a03e-part1
S: disk/by-path/pci-0000:00:09.0-scsi-3:0:0:0-part1
S: disk/by-uuid/bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: DEVLINKS=/dev/disk/by-id/ata-SAMSUNG_HD103SI_S1VSJ1LS301247-part1 /dev/disk/by-id/scsi-SATA_SAMSUNG_HD103SIS1VSJ1LS301247-part1 /dev/disk/by-id/wwn-0x50024e900136a03e-part1 /dev/disk/by-path/pci-0000:00:09.0-scsi-3:0:0:0-part1 /dev/disk/by-uuid/bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: DEVNAME=/dev/sdg1
E: DEVPATH=/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg/sdg1
E: DEVTYPE=partition
E: ID_ATA=1
E: ID_ATA_DOWNLOAD_MICROCODE=1
E: ID_ATA_FEATURE_SET_AAM=1
E: ID_ATA_FEATURE_SET_AAM_CURRENT_VALUE=254
E: ID_ATA_FEATURE_SET_AAM_ENABLED=1
E: ID_ATA_FEATURE_SET_AAM_VENDOR_RECOMMENDED_VALUE=254
E: ID_ATA_FEATURE_SET_APM=1
E: ID_ATA_FEATURE_SET_APM_ENABLED=0
E: ID_ATA_FEATURE_SET_HPA=1
E: ID_ATA_FEATURE_SET_HPA_ENABLED=1
E: ID_ATA_FEATURE_SET_PM=1
E: ID_ATA_FEATURE_SET_PM_ENABLED=1
E: ID_ATA_FEATURE_SET_PUIS=1
E: ID_ATA_FEATURE_SET_PUIS_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY=1
E: ID_ATA_FEATURE_SET_SECURITY_ENABLED=0
E: ID_ATA_FEATURE_SET_SECURITY_ENHANCED_ERASE_UNIT_MIN=194
E: ID_ATA_FEATURE_SET_SECURITY_ERASE_UNIT_MIN=194
E: ID_ATA_FEATURE_SET_SMART=1
E: ID_ATA_FEATURE_SET_SMART_ENABLED=1
E: ID_ATA_SATA=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN1=1
E: ID_ATA_SATA_SIGNAL_RATE_GEN2=1
E: ID_ATA_WRITE_CACHE=1
E: ID_ATA_WRITE_CACHE_ENABLED=1
E: ID_BUS=ata
E: ID_FS_TYPE=crypto_LUKS
E: ID_FS_USAGE=crypto
E: ID_FS_UUID=bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: ID_FS_UUID_ENC=bb024e1b-78a5-4ed0-9e80-aaa7633aa493
E: ID_FS_VERSION=1
E: ID_MODEL=SAMSUNG_HD103SI
E: ID_MODEL_ENC=SAMSUNG\x20HD103SI\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20
E: ID_PART_ENTRY_TYPE=0x83
E: ID_PART_TABLE_TYPE=dos
E: ID_PATH=pci-0000:00:09.0-scsi-3:0:0:0
E: ID_PATH_TAG=pci-0000_00_09_0-scsi-3_0_0_0
E: ID_REVISION=1AG01131
E: ID_SCSI_COMPAT=SATA_SAMSUNG_HD103SIS1VSJ1LS301247
E: ID_SERIAL=SAMSUNG_HD103SI_S1VSJ1LS301247
E: ID_SERIAL_SHORT=S1VSJ1LS301247
E: ID_TYPE=disk
E: ID_WWN=0x50024e900136a03e
E: ID_WWN_WITH_EXTENSION=0x50024e900136a03e
E: MAJOR=8
E: MINOR=97
E: PART_ENTRY_DISK=8:96
E: PART_ENTRY_NUMBER=1
E: PART_ENTRY_OFFSET=63
E: PART_ENTRY_SCHEME=dos
E: PART_ENTRY_SIZE=1953520002
E: SUBSYSTEM=block
E: UDEV_LOG=3
E: UDISKS_PARTITION=1
E: UDISKS_PARTITION_ALIGNMENT_OFFSET=0
E: UDISKS_PARTITION_NUMBER=1
E: UDISKS_PARTITION_OFFSET=32256
E: UDISKS_PARTITION_SCHEME=mbr
E: UDISKS_PARTITION_SIZE=1000202241024
E: UDISKS_PARTITION_SLAVE=/sys/devices/pci0000:00/0000:00:09.0/host3/target3:0:0/3:0:0:0/block/sdg
E: UDISKS_PARTITION_TYPE=0x83
E: UDISKS_PRESENTATION_NOPOLICY=0
E: USEC_INITIALIZED=6897248001
OK, there is the serial.... but the problem persists - udev doesn't execute the rule and doesn't create /dev/aluguard. -
I am on my laptop, where I am trying to write some udev rules.
Firstly, as a test I tried to make a symlink when connecting my ext hd.
$ udevadm info /dev/sdb
E: ID_PART_TABLE_UUID=ea04843c-526e-45bf-9d45-beba1b180285
$ cat /etc/udev/rules.d/61-rules.rules
ENV{ID_PART_TABLE}=="ea04843c-526e-45bf-9d45-beba1b180285" NAME="lilalum"
And well, nothing happens (there is no lilalum in /dev) when I plug in my ext hd.
Secondly, my low bat rule doesn't work.
$ cat /etc/udev/rules.d/99-lowbat.rules
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="10", RUN+="/usr/bin/systemctl suspend"
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="9", RUN+="/usr/bin/systemctl suspend"
SUBSYSTEM=="power_supply", ATTR{status}=="Discharging", ATTR{capacity}=="8", RUN+="/usr/bin/systemctl suspend"
It just doesn't do anything when the battery gets that low, and no the battery did not skip both 10, 9 and 8 percent.
Last edited by Ploppz (2014-05-03 12:41:02)Ah... thanks, it works now!
One more small issue... I tried writing a test to detect when the charger of my laptop gets plugged in or out, I put it in 61-rules.rules
SUBSYSTEM=="power_supply", RUN+="/usr/bin/touch /home/ploppz/charger"
The battery does send signals to udev:
$ udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent
# Plugging out:
KERNEL[944.333548] change /devices/platform/ACPI0003:00/power_supply/AC (power_supply)
UDEV [944.340228] change /devices/platform/ACPI0003:00/power_supply/AC (power_supply)
KERNEL[944.426599] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
UDEV [944.428599] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[944.470830] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
UDEV [944.472781] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
# Plugging in:
KERNEL[950.317263] change /devices/platform/ACPI0003:00/power_supply/AC (power_supply)
KERNEL[950.331752] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
UDEV [950.332023] change /devices/platform/ACPI0003:00/power_supply/AC (power_supply)
KERNEL[950.332576] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
UDEV [950.333609] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
UDEV [950.334891] change /devices/LNXSYSTM:00/device:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
I also tried putting it in 99-lowbat.rules, stilll no luck. I'm also wondering whether udev reads all the rules every time an event happens, or if it caches them such that when I write a rule, I'll have to either wait a bit or do some action to update the rules cache? -
[solved] udev-rules for bluetooth PCMCIA
My plan:
get my bluetooth-PCMCIA card to work:
CONCEPTONIC CBT100C
Problem:
I have to issue the following command for it to work:
#hciattach ttyS0 bcsp
Therefor I wrote following udev-rule that doesn't work:
##/etc/udev/rules.d/05-bluez-pcmcia-support.rules
SUBSYSTEMS=="pcmcia", ATTRS{prod_id2}=="Bluetooth Card", RUN+="/usr/sbin/hciattach ttyS0 bcsp"
My Question:
Could someone explain to me why this rule does not work?
Info:
#pccardctl info
PRODID_1="PCMCIA"
PRODID_2="Bluetooth Card"
PRODID_3=""
PRODID_4=""
MANFID=0279,950b
FUNCID=2
after #hciattach ttyS0 bcsp
#udevinfo -a -p /sys/devices/pci0000\:00/0000\:00\:1e.0/0000\:06\:09.0/0.0/tty/ttyS0/
KERNEL=="ttyS0"
SUBSYSTEM=="tty"
DRIVER==""
ATTR{dev}=="4:64"
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:06:09.0/0.0/tty':
KERNELS=="tty"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:06:09.0/0.0':
KERNELS=="0.0"
SUBSYSTEMS=="pcmcia"
DRIVERS=="serial_cs"
ATTRS{modalias}=="pcmcia:m0279c950Bf02fn00pfn00pa281F1C5Dpb7664FB1Dpc00000000pd00000000"
ATTRS{prod_id2}=="Bluetooth Card"
ATTRS{prod_id1}=="PCMCIA"
ATTRS{card_id}=="0x950b"
ATTRS{manf_id}=="0x0279"
ATTRS{func_id}=="0x02"
ATTRS{pm_state}=="on"
ATTRS{function}=="0x00"
looking at parent device '/devices/pci0000:00/0000:00:1e.0/0000:06:09.0':
KERNELS=="0000:06:09.0"
SUBSYSTEMS=="pci"
DRIVERS=="yenta_cardbus"
ATTRS{msi_bus}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{enable}=="2"
ATTRS{modalias}=="pci:v00001180d00000476sv0000144Dsd0000C01Ebc06sc07i00"
ATTRS{local_cpus}=="f"
ATTRS{irq}=="16"
ATTRS{class}=="0x060700"
ATTRS{subsystem_device}=="0xc01e"
ATTRS{subsystem_vendor}=="0x144d"
ATTRS{device}=="0x0476"
ATTRS{vendor}=="0x1180"
looking at parent device '/devices/pci0000:00/0000:00:1e.0':
KERNELS=="0000:00:1e.0"
SUBSYSTEMS=="pci"
DRIVERS==""
ATTRS{msi_bus}=="1"
ATTRS{broken_parity_status}=="0"
ATTRS{enable}=="1"
ATTRS{modalias}=="pci:v00008086d00002448sv00000000sd00000000bc06sc04i01"
ATTRS{local_cpus}=="f"
ATTRS{irq}=="0"
ATTRS{class}=="0x060401"
ATTRS{subsystem_device}=="0x0000"
ATTRS{subsystem_vendor}=="0x0000"
ATTRS{device}=="0x2448"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS==""
ATTRS{uevent}==""
#dmesg
pccard: PCMCIA card inserted into slot 0
cs: memory probe 0xb4000000-0xb40fffff: excluding 0xb4000000-0xb400ffff
pcmcia: registering new device pcmcia0.0
ttyS0: detected caps 00000700 should be 00000100
0.0: ttyS0 at I/O 0x400 (irq = 3) is a 16C950/954
Last edited by mehldutt (2007-08-07 18:04:37)I called it
05-bluez-pcmcia-support.rules
I rebooted but still no success.
I also tried this:
ACTION=="add", SUBSYSTEMS=="pcmcia", ATTRS{prod_id2}=="Bluetooth Card", RUN+="aplay /usr/share/sounds/phone.wav"
But still no success -
[SOLVED] udev-rules
My plan is to write a udev-rule that automatically starts a backup script as soon as I plugin a specific usb-harddrive.
For testing purposes I'm trying to run /usr/bin/gedit and create the symlink /dev/backup-drive
here's my rule:
## /etc/udev/rules.d/95-backup.rules
SUBSYSTEM=="usb", ATTRS{serial}=="100", SYMLINK="backup_drive", RUN+="/usr/bin/gedit"
The symlink works fine. However, gedit does not start.
What am I missing?
Last edited by mehldutt (2007-04-26 18:12:44)here some more information:
# udevinfo -a -p $(udevinfo -q path -n /dev/sdb)
Udevinfo starts with the device specified by the devpath and then
walks up the chain of parent devices. It prints for every device
found, all possible attributes in the udev rules key format.
A rule to match, can be composed by the attributes of the device
and the attributes from one single parent device.
looking at device '/block/sdb':
KERNEL=="sdb"
SUBSYSTEM=="block"
DRIVER==""
ATTR{stat}==" 69 193 1022 352 14 4 144 68 0 332 420"
ATTR{size}=="156301488"
ATTR{removable}=="0"
ATTR{range}=="16"
ATTR{dev}=="8:16"
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-4/5-4:1.0/host2/target2:0:0/2:0:0:0':
KERNELS=="2:0:0:0"
SUBSYSTEMS=="scsi"
DRIVERS=="sd"
ATTRS{ioerr_cnt}=="0x0"
ATTRS{iodone_cnt}=="0x5a"
ATTRS{iorequest_cnt}=="0x5a"
ATTRS{iocounterbits}=="32"
ATTRS{timeout}=="30"
ATTRS{state}=="running"
ATTRS{rev}=="AD00"
ATTRS{model}=="MK8032GAX "
ATTRS{vendor}=="TOSHIBA "
ATTRS{scsi_level}=="3"
ATTRS{type}=="0"
ATTRS{queue_type}=="none"
ATTRS{queue_depth}=="1"
ATTRS{device_blocked}=="0"
ATTRS{max_sectors}=="240"
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-4/5-4:1.0/host2/target2:0:0':
KERNELS=="target2:0:0"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-4/5-4:1.0/host2':
KERNELS=="host2"
SUBSYSTEMS==""
DRIVERS==""
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-4/5-4:1.0':
KERNELS=="5-4:1.0"
SUBSYSTEMS=="usb"
DRIVERS=="usb-storage"
ATTRS{interface}=="Mass Storage Class"
ATTRS{modalias}=="usb:v04CFp8818dB008dc00dsc00dp00ic08isc05ip50"
ATTRS{bInterfaceProtocol}=="50"
ATTRS{bInterfaceSubClass}=="05"
ATTRS{bInterfaceClass}=="08"
ATTRS{bNumEndpoints}=="02"
ATTRS{bAlternateSetting}==" 0"
ATTRS{bInterfaceNumber}=="00"
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5/5-4':
KERNELS=="5-4"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{serial}=="100"
ATTRS{product}=="USB Mass Storage Device"
ATTRS{manufacturer}=="Myson Century, Inc."
ATTRS{maxchild}=="0"
ATTRS{version}==" 2.00"
ATTRS{devnum}=="2"
ATTRS{speed}=="480"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bNumConfigurations}=="1"
ATTRS{bDeviceProtocol}=="00"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceClass}=="00"
ATTRS{bcdDevice}=="b008"
ATTRS{idProduct}=="8818"
ATTRS{idVendor}=="04cf"
ATTRS{bMaxPower}==" 10mA"
ATTRS{bmAttributes}=="c0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{configuration}=="USB Mass Storage"
looking at parent device '/devices/pci0000:00/0000:00:1d.7/usb5':
KERNELS=="usb5"
SUBSYSTEMS=="usb"
DRIVERS=="usb"
ATTRS{serial}=="0000:00:1d.7"
ATTRS{product}=="EHCI Host Controller"
ATTRS{manufacturer}=="Linux 2.6.20-ARCH ehci_hcd"
ATTRS{maxchild}=="8"
ATTRS{version}==" 2.00"
ATTRS{devnum}=="1"
ATTRS{speed}=="480"
ATTRS{bMaxPacketSize0}=="64"
ATTRS{bNumConfigurations}=="1"
ATTRS{bDeviceProtocol}=="01"
ATTRS{bDeviceSubClass}=="00"
ATTRS{bDeviceClass}=="09"
ATTRS{bcdDevice}=="0206"
ATTRS{idProduct}=="0000"
ATTRS{idVendor}=="0000"
ATTRS{bMaxPower}==" 0mA"
ATTRS{bmAttributes}=="e0"
ATTRS{bConfigurationValue}=="1"
ATTRS{bNumInterfaces}==" 1"
ATTRS{configuration}==""
looking at parent device '/devices/pci0000:00/0000:00:1d.7':
KERNELS=="0000:00:1d.7"
SUBSYSTEMS=="pci"
DRIVERS=="ehci_hcd"
ATTRS{msi_bus}==""
ATTRS{broken_parity_status}=="0"
ATTRS{enable}=="1"
ATTRS{modalias}=="pci:v00008086d0000265Csv0000144Dsd0000C01Ebc0Csc03i20"
ATTRS{local_cpus}=="f"
ATTRS{irq}=="19"
ATTRS{class}=="0x0c0320"
ATTRS{subsystem_device}=="0xc01e"
ATTRS{subsystem_vendor}=="0x144d"
ATTRS{device}=="0x265c"
ATTRS{vendor}=="0x8086"
looking at parent device '/devices/pci0000:00':
KERNELS=="pci0000:00"
SUBSYSTEMS==""
DRIVERS=="" -
[SOLVED] udev rules for U2F FIDO Plug-up key
I just received a cheap U2F FIDO key (http://www.amazon.com/Plug-up-Internati … 00OGPO3ZS/) but couldn't use it under Chrome 38. I had to add the following rule to /etc/udev/rules.d/45-u2f.rules
SUBSYSTEM=="hidraw", MODE="0666", ATTRS{idVendor}=="2581", ATTRS{idProduct}=="f1d0"
and then issued a
# sudo udevadm trigger
Should work with other vendors assuming you change the idVendor and idProduct.
Have fun!LukeHandle wrote:Was thinking about the same device, what are you thoughts on it so far? I was mostly concerned with the price and how that translated to the quality, or lack thereof.
The device for which I sent a link for is cheap one and when you receive it actually looks cheap but does the job. Initially I thought I needed to install the FIDO U2F Chrome extension https://chrome.google.com/webstore/deta … ionmgcdmne but it works just fine without it assuming you are using Chrome or Chromium 38+ and the above udev rule on ArchLinux (not required on Windows and MAC OS).
Use case is fairly limited so far since it can only be used on Google account. I tried to use this Plug-Up U2F dongle on Yubico U2F demo page http://demo.yubico.com/start/u2f/neo but it doesn't work and thus even with the FIDO U2F Chrome extension...Weird since I thought all U2F will all be compatible. Since the protocol is open I hope other use cases will arise such as more major supported websites, easy integration in existing frameworks such as Wordpress, Roundcube... but also alternative uses such as 2nd factor authentication for disk encryption (LUKS). -
Own udev rule doesn't work at all
Hi,
I've trouble to write my own udev rule. I tried the following but it doesn't work at all.
I created the following file /etc/udev/rules.d/90-monitor-hotplug.rules with the following content:
# test
SUBSYSTEMS="usb", RUN+="/bin/sh -c '/bin/echo mon >> /tmp/monitor.log'"
run
> udevadm control --reload
Now I assumed with every usb event, e.g plugin of an usb memory stick it should spam something in /tmp/monitor.log
But nothing happens.
Can anybody tell me what I'm doing wrong. I guess it's something really stupid.
Thanks
JakobYou haven't used an equality operator in your first line (2x "="). Other than that, it looks fine to me.
So try:
# test
SUBSYSTEMS=="usb", RUN+="/bin/sh -c '/bin/echo mon >> /tmp/monitor.log'"
run
> udevadm control --reload -
[SOLVED] USB 3G no longer works after upgrade to GNOME 3.8
I did the 'big' update today, including upgrading to GNOME 3.8. Unfortunately, NetworkManager no longer picks up my 3G USB modem (which used to work fine before the update). Any pointers as to how I could debug this would be greatly appreciated.
wvdial has never really worked for me, but gnome networkmanager used to pick up my device and the connection, and now simply acts as if it's no longer present. Attempting to follow the instructions on the wiki to re-setup my USB stick (the instructions I followed in the first place) no longer works. Did today's update cause the same problem for anybody else?
**Update: After updating today to modemmanager 0.7.990-4 and running
sudo systemctl enable ModemManager
sudo systemctl start ModemManager
I have full connectivity again with the built-in DW5550 mobile broadband card in my Dell Precision M6600 (including showing signal strength in the GNOME 3.8 top bar, etc). Thanks all for the help, and (most importantly) to whoever fixed up modemmanager!
Last edited by dawid.loubser (2013-04-26 16:57:42)wvdial might also be a workaround, if one does not like to downgrade. In my case, I had to unset my PIN on the SIM card first. One can do that using a mobile phone, for example.
Then
# pacman -S wvdial
in /etc/wvdial.conf, I put
[Dialer Defaults]
Init2 = ATQ0 V1 E1 S0=0 &C1 &D2 +FCLASS=0
Modem Type = Analog Modem
ISDN = 0
Stupid Mode = 1
Dial Attempts = 3
Init1 = ATZ
[Dialer huawei]
Modem = /dev/serial/by-id/usb-ZTE_Incorporated_1_1_Surf-stick_MF19001MOD010000-if02-port0
Baud = 115200
[Dialer voda]
Init3 = AT+CGDCONT=1,"IP","web.vodafone.de"
[Dialer dial]
Phone=*99**1#
Username = umts
Password = umts
You can find out your modem name by looking it up with
ls /dev/serial/by-id/
In my case there were names containing the strings if00, if01 and if02, and if02 turned out to be the correct one. This depends on hardware.
Also, in the "Init 3" line, you may have to replace "web.vodafone.de" according to your provider. The section "dial" seems to be quite universal from what I read on the web, so you may not have to change that.
then
# wvdial huawei voda dial
and hope for the best.
Disclaimer: I do not have a comprehensive understanding of what I did here, but it worked in my case and it might work for you, too.
I noticed that the Defaults section makes a difference, because the one I just edited in above avoids some delay in dialing.
Last edited by tobi-fankhaenel (2013-04-23 08:23:00) -
[SOLVED] Openbox autostart no longer working since upgrade
After the upgrade on May 14 2013 my autostart file no longer works. I tried renaming my autostart.sh to just autostart no luck. There is nothing wrong with the autostart file as I can run it manually and it will load all my apps. Also, if I cd to /usr/lib/openbox/ and run openbox-autostart directly it works. Here are the updated packages:
[2013-05-14 21:34] [PACMAN] upgraded ethtool (1:3.8-1 -> 1:3.9-1)
[2013-05-14 21:34] [PACMAN] upgraded firefox (20.0.1-5 -> 21.0-1)
[2013-05-14 21:34] [PACMAN] upgraded gsettings-desktop-schemas (3.8.0-1 -> 3.8.2-1)
[2013-05-14 21:34] [PACMAN] upgraded glib-networking (2.36.1-1 -> 2.36.2-1)
[2013-05-14 21:34] [PACMAN] upgraded gnome-icon-theme-symbolic (3.8.0.1-2 -> 3.8.2.2-1)
[2013-05-14 21:34] [PACMAN] upgraded gnome-icon-theme (3.8.0-1 -> 3.8.2-1)
[2013-05-14 21:34] [PACMAN] upgraded gnupg (2.0.19-7 -> 2.0.20-1)
[2013-05-14 21:34] [PACMAN] upgraded gtkmm (2.24.2-2 -> 2.24.3-1)
[2013-05-14 21:34] [PACMAN] upgraded gvfs (1.16.1-2 -> 1.16.2-1)
[2013-05-14 21:34] [PACMAN] upgraded libical (0.48-1 -> 1.0-2)
[2013-05-14 21:34] [PACMAN] upgraded mplayer (35920-2 -> 35920-3)
[2013-05-14 21:34] [PACMAN] upgraded orage (4.8.4-1 -> 4.8.4-2)
[2013-05-14 21:34] [PACMAN] upgraded pango (1.34.0-1 -> 1.34.1-1)
[2013-05-14 21:34] [PACMAN] upgraded pdnsd (1.2.9.a-1 -> 1.2.9.a-2)
[2013-05-14 21:34] [PACMAN] upgraded python2-distribute (0.6.38-1 -> 0.6.39-1)
[2013-05-14 21:34] [PACMAN] upgraded python2-zope-interface (4.0.3-1 -> 4.0.5-1)
[2013-05-14 21:34] [PACMAN] upgraded sudo (1.8.6.p8-1 -> 1.8.6.p8-2)
[2013-05-14 21:34] [PACMAN] upgraded thunderbird (17.0.5-2 -> 17.0.6-1)
[2013-05-14 21:34] [PACMAN] upgraded virtualbox (4.2.12-2 -> 4.2.12-3)
[2013-05-14 21:34] [PACMAN] upgraded vte-common (0.34.4-1 -> 0.34.5-1)
[2013-05-14 21:35] [PACMAN] upgraded python3-threaded_servers (2013.5.12.3-1 -> 2013.5.14.1-1)
Not sure what's going on or what could have caused it. My .xinitrc looks like this:
#!/bin/sh
if [ -d /etc/X11/xinit/xinitrc.d ]; then
for f in /etc/X11/xinit/xinitrc.d/*; do
[ -x "$f" ] && . "$f"
done
unset f
fi
export BROWSER="chromium"
# Start GNOME Keyring
eval $(/usr/bin/gnome-keyring-daemon --start --components=gpg,pkcs11,secrets,ssh)
# You probably need to do this too:
export SSH_AUTH_SOCK
export GPG_AGENT_INFO
export GNOME_KEYRING_CONTROL
export GNOME_KEYRING_PID
exec openbox-session
My .zprofile
[[ -z $DISPLAY && $XDG_VTNR -eq 1 ]] && startx &> ~/.xlog
My systemd startup service:
# This file is part of systemd.
# systemd is free software; you can redistribute it and/or modify it
# under the terms of the GNU Lesser General Public License as published by
# the Free Software Foundation; either version 2.1 of the License, or
# (at your option) any later version.
[Unit]
Description=Getty on %I
Documentation=man:agetty(8) man:systemd-getty-generator(8)
Documentation=http://0pointer.de/blog/projects/serial-console.html
After=systemd-user-sessions.service plymouth-quit-wait.service
After=rc-local.service
# If additional gettys are spawned during boot then we should make
# sure that this is synchronized before getty.target, even though
# getty.target didn't actually pull it in.
Before=getty.target
IgnoreOnIsolate=yes
# On systems without virtual consoles, don't start any getty. (Note
# that serial gettys are covered by [email protected], not this
# unit
ConditionPathExists=/dev/tty0
[Service]
# the VT is cleared by TTYVTDisallocate
ExecStart=-/sbin/agetty -a dodo3773 %I 38400
Type=simple
#Restart=always
#RestartSec=0
UtmpIdentifier=%I
TTYPath=/dev/%I
TTYReset=no
TTYVHangup=no
TTYVTDisallocate=no
KillMode=process
IgnoreSIGPIPE=no
# Unset locale for the console getty since the console has problems
# displaying some internationalized messages.
Environment=LANG= LANGUAGE= LC_CTYPE= LC_NUMERIC= LC_TIME= LC_COLLATE= LC_MONETARY= LC_MESSAGES= LC_PAPER= LC_NAME= LC_ADDRESS= LC_TELEPHONE= LC_MEASUREMENT= LC_IDENTIFICATION=
# Some login implementations ignore SIGTERM, so we send SIGHUP
# instead, to ensure that login terminates cleanly.
KillSignal=SIGHUP
[Install]
WantedBy=getty.target
Edit: I tried switching to bash in a tty and then just startx but that doesn't help either.
Edit2: To be clear openbox does load a desktop. The autostart scripts at ~/.config/openbox/ just don't run. Thanks.
Edit3: I decided to run the command issued in openbox-session and added --debug to it. Here is the output of "xinit /usr/bin/openbox --debug --startup "/usr/lib/openbox/openbox-autostart OPENBOX" "$@" -- :1 -nolisten tcp" :
X.Org X Server 1.14.1
Release Date: 2013-04-17
X Protocol Version 11, Revision 0
Build Operating System: Linux 3.8.7-1-ARCH x86_64
Current Operating System: Linux dodo713 3.9.2-2-ck #1 SMP PREEMPT Sun May 12 18:19:49 EDT 2013 x86_64
Kernel command line: BOOT_IMAGE=/vmlinuz-linux-ck root=UUID=06874255-7a5d-4968-8f09-1e53cb761f44 ro quiet init=/usr/lib/systemd/systemd
Build Date: 17 April 2013 02:37:06PM
Current version of pixman: 0.30.0
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (--) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: "/var/log/Xorg.1.log", Time: Fri May 17 08:14:11 2013
(==) Using config file: "/etc/X11/xorg.conf"
(==) Using config directory: "/etc/X11/xorg.conf.d"
setversion 1.4 failed
Initializing built-in extension Generic Event Extension
Initializing built-in extension SHAPE
Initializing built-in extension MIT-SHM
Initializing built-in extension XInputExtension
Initializing built-in extension XTEST
Initializing built-in extension BIG-REQUESTS
Initializing built-in extension SYNC
Initializing built-in extension XKEYBOARD
Initializing built-in extension XC-MISC
Initializing built-in extension SECURITY
Initializing built-in extension XINERAMA
Initializing built-in extension XFIXES
Initializing built-in extension RENDER
Initializing built-in extension RANDR
Initializing built-in extension COMPOSITE
Initializing built-in extension DAMAGE
Initializing built-in extension MIT-SCREEN-SAVER
Initializing built-in extension DOUBLE-BUFFER
Initializing built-in extension RECORD
Initializing built-in extension DPMS
Initializing built-in extension X-Resource
Initializing built-in extension XVideo
Initializing built-in extension XVideo-MotionCompensation
Initializing built-in extension XFree86-VidModeExtension
Initializing built-in extension XFree86-DGA
Initializing built-in extension XFree86-DRI
Initializing built-in extension DRI2
Loading extension GLX
Loading extension NV-GLX
Loading extension NV-CONTROL
Loading extension XINERAMA
setversion 1.4 failed
Openbox-Debug: --startup /usr/lib/openbox/openbox-autostart OPENBOX
Openbox-Debug: Moving to desktop 1
Openbox-Debug: not managing override redirect window 0x4000bb
which: no hsetroot in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/usr/bin/core_perl:/home/dodo3773/Documents/Scripts:/home/dodo3773/Documents/Scripts)
which: no esetroot in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/usr/bin/core_perl:/home/dodo3773/Documents/Scripts:/home/dodo3773/Documents/Scripts)
which: no xsetroot in (/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/android-sdk/platform-tools:/usr/bin/core_perl:/home/dodo3773/Documents/Scripts:/home/dodo3773/Documents/Scripts)
kupfer: Reading from stdin
The XKEYBOARD keymap compiler (xkbcomp) reports:
> Warning: Compat map for group 2 redefined
> Using new definition
> Warning: Compat map for group 3 redefined
> Using new definition
> Warning: Compat map for group 4 redefined
> Using new definition
Errors from xkbcomp are not fatal to the X server
Openbox-Debug: Caught signal 22. Ignoring.
Openbox-Debug: UPDATE DESKTOP NAMES
Openbox-Debug: Keyboard map changed. Reloading keyboard bindings.
Edit4: Removed everything from /etc/xdg/autostart and ~/.config/autostart/ directories. That didn't work.
Edit5: Tried installing xorg-xsetroot to let openbox set the color of the wallpaper. That didn't work.
Edit6: Checked the output of "loginctl show-session $XDG_SESSION_ID" to make sure that wasn't the issue. Looks okay to me:
Id=1
Timestamp=Fri 2013-05-17 10:25:53 PDT
TimestampMonotonic=13650783
DefaultControlGroup=systemd:/user/1000.user/1.session
VTNr=1
TTY=tty1
Remote=no
Service=login
Leader=405
Audit=1
Type=tty
Class=user
Active=yes
State=active
KillProcesses=no
IdleHint=no
IdleSinceHint=1368811547544203
IdleSinceHintMonotonic=7545641
Name=dodo3773
Edit7: Tried installing xorg-xrdb thinking maybe that would help and did todays updates. No luck yet.
Edit8: Kupfer still loads even though nothing else does. So I uninstalled kupfer. Same thing though. No autostart.
Edit9: Tried booting into repo kernel instead of ck kernel. Didn't work.
Last edited by dodo3773 (2013-05-19 06:34:44)WonderWoofy wrote:Interestingly, of all those things you included in your post, you forgot to include the autostart script itself. What does that look like?
Well, since it worked fine even when called indirectly through openbox-autostart and since it's worked fine for months I figured it was fine. I am happy to post it though. Here you go:
feh --bg-scale /home/dodo3773/Pictures/blacksolid.png &
xfce4-panel &
numlockx &
keepassx -lock &
kupfer --no-splash &
~/Documents/Scripts/startupopen.sh &
sleep 30 && sudo /usr/bin/ntpd -qg &
sudo /usr/sbin/ethtool -K eth0 rx off &
~/Documents/Scripts/conky.sh &
sudo /home/dodo3773/Documents/Scripts/temp_throttlenew > /dev/null 2>&1 &
Here are the external scripts that are called (startupopen.sh and temp_throttlenew):
startupopen.sh
#! /bin/bash
sleep 13
chromium &
thunderbird &
sleep 20
devilspie -a &
sleep 7
pkill devilspie &
exit
temp_throttlenew
#!/bin/bash
# temp_throttle.sh max_temp
# USE CELSIUS TEMPERATURES.
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root" 1>&2
exit 1
fi
#if [ $# -ne 1 ]; then
# If temperature wasn't given, then print a message and exit.
# echo "Please supply a maximum desired temperature in Celsius." 1>&2
# echo "For example: ${0} 60" 1>&2
# exit 2
#else
#Set the first argument as the maximum desired temperature.
MAX_TEMP=85
#fi
# The frequency will increase when low temperature is reached.
let LOW_TEMP=$MAX_TEMP-5
CORES=$(nproc) # Get number of CPU cores.
echo -e "Number of CPU cores detected: $CORES\n"
# Temperatures internally are calculated to the thousandth.
MAX_TEMP=${MAX_TEMP}000
LOW_TEMP=${LOW_TEMP}000
# FREQ_LIST is a list (array) of all available cpu frequencies the system allows.
declare -a FREQ_LIST=($(cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies))
# CURRENT_FREQ relates to the FREQ_LIST by keeping record of the currently set frequency.
let CURRENT_FREQ=1
function set_freq {
echo ${FREQ_LIST[$1]}
cpupower frequency-set -g "ondemand" -d "800MHz" -u ${FREQ_LIST[$1]}
function throttle {
if [ $CURRENT_FREQ -ne $((${#FREQ_LIST[@]}-1)) ]; then
let CURRENT_FREQ+=1
echo -n "throttle "
set_freq $CURRENT_FREQ
fi
function unthrottle {
if [ $CURRENT_FREQ -ne 0 ]; then
let CURRENT_FREQ-=1
echo -n "unthrottle "
set_freq $CURRENT_FREQ
fi
function get_temp {
# Get the system temperature.
# If one of these doesn't work, the try uncommenting another.
TEMP=$(cat /sys/class/thermal/thermal_zone0/temp)
#TEMP=$(cat /sys/class/hwmon/hwmon0/temp1_input)
#TEMP=$(cat /sys/class/hwmon/hwmon1/device/temp1_input)
while true; do
get_temp
if [ $TEMP -gt $MAX_TEMP ]; then # Throttle if too hot.
throttle
elif [ $TEMP -le $LOW_TEMP ]; then # Unthrottle if cool.
unthrottle
fi
sleep 3
done
Stuff that needs sudo is in my sudoers as "username hostname NOPASSWD: item1,item2,etc,etc". Nothing too exciting. Seems like if there was suddenly something wrong with my autostart file at least some of the stuff would run either way though cause of "&". Pretty puzzling this issue is.
Maybe you are looking for
-
Report for Jobs running at a frequency of lesss than 1 hour
Hi All, I am new to the world of scripting. I wanted to have a script/report which gives me the list of jobs which are running at a frequency of less than one hour. Please advise how should i go about it. Thanks in Advance Vinay Bhalotia
-
App Server 7 EE errors Please help
Hi all I have a cluster of 3 App Servers 7 EE load balanced by 3 Web Servers.6.1 When i access my clustered application it suddenly becomes slow and i get these 3 errors on and on in the Web Servers log: [24/Nov/2004:12:48:55] warning ( 3510): for ho
-
Diagnostics(How to view the log files)
Hi All, In weblogic 9.2MP3, In the console navigate through the following , Diagnostics->log files->server logs. Click on customize this table. Select logging as custom. My question is what should be the Start Time and End Time format when logging se
-
Avoid report refresh when updating cascade parameters
I have a report with 3 cascade parameters. The first parameter, region, is independent. The second parameter, zone, depends on region. The third parameter, store, depends both on region and zone. These are multi value parameters. The report is viewed
-
I need help very badly.... Here is the reader's digest version..... I purchased a flash website template for my local band to try to elimate the pain of creating one from scratch. I never used Adobe Flash CS3 before, but figured I could figure out en