udev event triggering multiple times and not respecting matching conditions












2















I'm attempting to write a udev rule that triggers when my laptop power cable is plugged in, however I'm having some odd issues with it triggering multiple times, on both plugging and unplugging.



First, I get the name of the device:



$ udevadm monitor --subsystem-match power_supply


I happen to know the name of the subsystem already, but it doesn't actually matter. I then plug in the power cable.



KERNEL[771.036377] change   /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[771.553813] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.603337] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.791301] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)


From this I can see there are 4 events, 2 of which belong to the BAT0 device and 2 the AC device.

Then I look at the attributes of the AC device to see what I can trigger off of.



$ udevadm info -a /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC

looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC':
KERNEL=="AC"
SUBSYSTEM=="power_supply"
DRIVER==""
ATTR{SUBSYSTEM}=="power_supply"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00':
KERNELS=="ACPI0003:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ac"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ac"
ATTRS{MODALIAS}=="acpi:ACPI0003:"
ATTRS{USEC_INITIALIZED}=="3654374"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00':
KERNELS=="PNP0C09:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ec"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ec"
ATTRS{MODALIAS}=="acpi:PNP0C09:"
ATTRS{USEC_INITIALIZED}=="3588332"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08':
KERNELS=="device:08"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00':
KERNELS=="PNP0A08:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:PNP0A08:PNP0A03:"
ATTRS{USEC_INITIALIZED}=="3301031"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
KERNELS=="LNXSYBUS:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYBUS:"
ATTRS{USEC_INITIALIZED}=="3246891"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00':
KERNELS=="LNXSYSTM:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYSTM:"
ATTRS{USEC_INITIALIZED}=="3107859"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"


From this, trying to be as specific as possible, using attributes from the device itself as well as the parents I construct this rule:



ACTION=="change"
SUBSYSTEM=="power_supply"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


Upon saving it and unplugging/replugging my laptop, I find that the script has ran 10's of times. Is there any way to trace why this is happening when the monitor only showed 4 events (all but one of which shouldn't have matched anyway?)



However perhaps there is a more general problem, as I find the rule triggers even if obviously unmatching conditions are contained within it, such as



ACTION=="change"
SUBSYSTEM=="Not even the right subsystem!"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="Totally Fake Name"
ATTR{POWER_SUPPLY_ONLINE}=="Definitely not right"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


I'm guessing that there is something wrong with how I'm matching things, does it not work how I thought? I did read the udev man page and all examples online seem to follow a similar pattern.










share|improve this question




















  • 3





    this may be completely stupid (I hate udev & I'm on a phone) but weren't udev rules supposed to be separated by commas and written on the same line (or multiple lines terminated by a backslash line continuation)?

    – mosvy
    Feb 10 at 18:55













  • Try adding comma + backslash at the end of each line but the last RUN+="...". (The stupid web interface of this silly website won't let me enter them in a comment)

    – mosvy
    Feb 10 at 19:04











  • @mosvy Oh silly me, that was indeed the issue. I think I misread a part of the man page on that bit. Thanks.

    – JoshuaO
    Feb 10 at 22:29
















2















I'm attempting to write a udev rule that triggers when my laptop power cable is plugged in, however I'm having some odd issues with it triggering multiple times, on both plugging and unplugging.



First, I get the name of the device:



$ udevadm monitor --subsystem-match power_supply


I happen to know the name of the subsystem already, but it doesn't actually matter. I then plug in the power cable.



KERNEL[771.036377] change   /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[771.553813] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.603337] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.791301] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)


From this I can see there are 4 events, 2 of which belong to the BAT0 device and 2 the AC device.

Then I look at the attributes of the AC device to see what I can trigger off of.



$ udevadm info -a /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC

looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC':
KERNEL=="AC"
SUBSYSTEM=="power_supply"
DRIVER==""
ATTR{SUBSYSTEM}=="power_supply"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00':
KERNELS=="ACPI0003:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ac"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ac"
ATTRS{MODALIAS}=="acpi:ACPI0003:"
ATTRS{USEC_INITIALIZED}=="3654374"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00':
KERNELS=="PNP0C09:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ec"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ec"
ATTRS{MODALIAS}=="acpi:PNP0C09:"
ATTRS{USEC_INITIALIZED}=="3588332"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08':
KERNELS=="device:08"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00':
KERNELS=="PNP0A08:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:PNP0A08:PNP0A03:"
ATTRS{USEC_INITIALIZED}=="3301031"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
KERNELS=="LNXSYBUS:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYBUS:"
ATTRS{USEC_INITIALIZED}=="3246891"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00':
KERNELS=="LNXSYSTM:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYSTM:"
ATTRS{USEC_INITIALIZED}=="3107859"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"


From this, trying to be as specific as possible, using attributes from the device itself as well as the parents I construct this rule:



ACTION=="change"
SUBSYSTEM=="power_supply"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


Upon saving it and unplugging/replugging my laptop, I find that the script has ran 10's of times. Is there any way to trace why this is happening when the monitor only showed 4 events (all but one of which shouldn't have matched anyway?)



However perhaps there is a more general problem, as I find the rule triggers even if obviously unmatching conditions are contained within it, such as



ACTION=="change"
SUBSYSTEM=="Not even the right subsystem!"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="Totally Fake Name"
ATTR{POWER_SUPPLY_ONLINE}=="Definitely not right"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


I'm guessing that there is something wrong with how I'm matching things, does it not work how I thought? I did read the udev man page and all examples online seem to follow a similar pattern.










share|improve this question




















  • 3





    this may be completely stupid (I hate udev & I'm on a phone) but weren't udev rules supposed to be separated by commas and written on the same line (or multiple lines terminated by a backslash line continuation)?

    – mosvy
    Feb 10 at 18:55













  • Try adding comma + backslash at the end of each line but the last RUN+="...". (The stupid web interface of this silly website won't let me enter them in a comment)

    – mosvy
    Feb 10 at 19:04











  • @mosvy Oh silly me, that was indeed the issue. I think I misread a part of the man page on that bit. Thanks.

    – JoshuaO
    Feb 10 at 22:29














2












2








2








I'm attempting to write a udev rule that triggers when my laptop power cable is plugged in, however I'm having some odd issues with it triggering multiple times, on both plugging and unplugging.



First, I get the name of the device:



$ udevadm monitor --subsystem-match power_supply


I happen to know the name of the subsystem already, but it doesn't actually matter. I then plug in the power cable.



KERNEL[771.036377] change   /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[771.553813] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.603337] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.791301] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)


From this I can see there are 4 events, 2 of which belong to the BAT0 device and 2 the AC device.

Then I look at the attributes of the AC device to see what I can trigger off of.



$ udevadm info -a /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC

looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC':
KERNEL=="AC"
SUBSYSTEM=="power_supply"
DRIVER==""
ATTR{SUBSYSTEM}=="power_supply"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00':
KERNELS=="ACPI0003:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ac"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ac"
ATTRS{MODALIAS}=="acpi:ACPI0003:"
ATTRS{USEC_INITIALIZED}=="3654374"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00':
KERNELS=="PNP0C09:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ec"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ec"
ATTRS{MODALIAS}=="acpi:PNP0C09:"
ATTRS{USEC_INITIALIZED}=="3588332"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08':
KERNELS=="device:08"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00':
KERNELS=="PNP0A08:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:PNP0A08:PNP0A03:"
ATTRS{USEC_INITIALIZED}=="3301031"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
KERNELS=="LNXSYBUS:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYBUS:"
ATTRS{USEC_INITIALIZED}=="3246891"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00':
KERNELS=="LNXSYSTM:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYSTM:"
ATTRS{USEC_INITIALIZED}=="3107859"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"


From this, trying to be as specific as possible, using attributes from the device itself as well as the parents I construct this rule:



ACTION=="change"
SUBSYSTEM=="power_supply"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


Upon saving it and unplugging/replugging my laptop, I find that the script has ran 10's of times. Is there any way to trace why this is happening when the monitor only showed 4 events (all but one of which shouldn't have matched anyway?)



However perhaps there is a more general problem, as I find the rule triggers even if obviously unmatching conditions are contained within it, such as



ACTION=="change"
SUBSYSTEM=="Not even the right subsystem!"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="Totally Fake Name"
ATTR{POWER_SUPPLY_ONLINE}=="Definitely not right"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


I'm guessing that there is something wrong with how I'm matching things, does it not work how I thought? I did read the udev man page and all examples online seem to follow a similar pattern.










share|improve this question
















I'm attempting to write a udev rule that triggers when my laptop power cable is plugged in, however I'm having some odd issues with it triggering multiple times, on both plugging and unplugging.



First, I get the name of the device:



$ udevadm monitor --subsystem-match power_supply


I happen to know the name of the subsystem already, but it doesn't actually matter. I then plug in the power cable.



KERNEL[771.036377] change   /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)
KERNEL[771.553813] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.603337] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC (power_supply)
UDEV [771.791301] change /devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/PNP0C0A:00/power_supply/BAT0 (power_supply)


From this I can see there are 4 events, 2 of which belong to the BAT0 device and 2 the AC device.

Then I look at the attributes of the AC device to see what I can trigger off of.



$ udevadm info -a /sys/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC

looking at device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00/power_supply/AC':
KERNEL=="AC"
SUBSYSTEM=="power_supply"
DRIVER==""
ATTR{SUBSYSTEM}=="power_supply"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00/ACPI0003:00':
KERNELS=="ACPI0003:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ac"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ac"
ATTRS{MODALIAS}=="acpi:ACPI0003:"
ATTRS{USEC_INITIALIZED}=="3654374"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08/PNP0C09:00':
KERNELS=="PNP0C09:00"
SUBSYSTEMS=="acpi"
DRIVERS=="ec"
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{DRIVER}=="ec"
ATTRS{MODALIAS}=="acpi:PNP0C09:"
ATTRS{USEC_INITIALIZED}=="3588332"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00/device:08':
KERNELS=="device:08"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00/PNP0A08:00':
KERNELS=="PNP0A08:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:PNP0A08:PNP0A03:"
ATTRS{USEC_INITIALIZED}=="3301031"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00/LNXSYBUS:00':
KERNELS=="LNXSYBUS:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYBUS:"
ATTRS{USEC_INITIALIZED}=="3246891"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"

looking at parent device '/devices/LNXSYSTM:00':
KERNELS=="LNXSYSTM:00"
SUBSYSTEMS=="acpi"
DRIVERS==""
ATTRS{SUBSYSTEM}=="acpi"
ATTRS{MODALIAS}=="acpi:LNXSYSTM:"
ATTRS{USEC_INITIALIZED}=="3107859"
ATTRS{ID_VENDOR_FROM_DATABASE}=="The Linux Foundation"


From this, trying to be as specific as possible, using attributes from the device itself as well as the parents I construct this rule:



ACTION=="change"
SUBSYSTEM=="power_supply"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="AC"
ATTR{POWER_SUPPLY_ONLINE}=="1"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


Upon saving it and unplugging/replugging my laptop, I find that the script has ran 10's of times. Is there any way to trace why this is happening when the monitor only showed 4 events (all but one of which shouldn't have matched anyway?)



However perhaps there is a more general problem, as I find the rule triggers even if obviously unmatching conditions are contained within it, such as



ACTION=="change"
SUBSYSTEM=="Not even the right subsystem!"
DRIVERS=="ac"
ATTR{POWER_SUPPLY_NAME}=="Totally Fake Name"
ATTR{POWER_SUPPLY_ONLINE}=="Definitely not right"
RUN+="/usr/bin/bash /home/josh/scripts/udev_sleep.sh"


I'm guessing that there is something wrong with how I'm matching things, does it not work how I thought? I did read the udev man page and all examples online seem to follow a similar pattern.







linux udev






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 10 at 18:50









Rui F Ribeiro

40.5k1479137




40.5k1479137










asked Feb 10 at 18:37









JoshuaOJoshuaO

111




111








  • 3





    this may be completely stupid (I hate udev & I'm on a phone) but weren't udev rules supposed to be separated by commas and written on the same line (or multiple lines terminated by a backslash line continuation)?

    – mosvy
    Feb 10 at 18:55













  • Try adding comma + backslash at the end of each line but the last RUN+="...". (The stupid web interface of this silly website won't let me enter them in a comment)

    – mosvy
    Feb 10 at 19:04











  • @mosvy Oh silly me, that was indeed the issue. I think I misread a part of the man page on that bit. Thanks.

    – JoshuaO
    Feb 10 at 22:29














  • 3





    this may be completely stupid (I hate udev & I'm on a phone) but weren't udev rules supposed to be separated by commas and written on the same line (or multiple lines terminated by a backslash line continuation)?

    – mosvy
    Feb 10 at 18:55













  • Try adding comma + backslash at the end of each line but the last RUN+="...". (The stupid web interface of this silly website won't let me enter them in a comment)

    – mosvy
    Feb 10 at 19:04











  • @mosvy Oh silly me, that was indeed the issue. I think I misread a part of the man page on that bit. Thanks.

    – JoshuaO
    Feb 10 at 22:29








3




3





this may be completely stupid (I hate udev & I'm on a phone) but weren't udev rules supposed to be separated by commas and written on the same line (or multiple lines terminated by a backslash line continuation)?

– mosvy
Feb 10 at 18:55







this may be completely stupid (I hate udev & I'm on a phone) but weren't udev rules supposed to be separated by commas and written on the same line (or multiple lines terminated by a backslash line continuation)?

– mosvy
Feb 10 at 18:55















Try adding comma + backslash at the end of each line but the last RUN+="...". (The stupid web interface of this silly website won't let me enter them in a comment)

– mosvy
Feb 10 at 19:04





Try adding comma + backslash at the end of each line but the last RUN+="...". (The stupid web interface of this silly website won't let me enter them in a comment)

– mosvy
Feb 10 at 19:04













@mosvy Oh silly me, that was indeed the issue. I think I misread a part of the man page on that bit. Thanks.

– JoshuaO
Feb 10 at 22:29





@mosvy Oh silly me, that was indeed the issue. I think I misread a part of the man page on that bit. Thanks.

– JoshuaO
Feb 10 at 22:29










0






active

oldest

votes











Your Answer








StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "106"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499804%2fudev-event-triggering-multiple-times-and-not-respecting-matching-conditions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























0






active

oldest

votes








0






active

oldest

votes









active

oldest

votes






active

oldest

votes
















draft saved

draft discarded




















































Thanks for contributing an answer to Unix & Linux Stack Exchange!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f499804%2fudev-event-triggering-multiple-times-and-not-respecting-matching-conditions%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

How to reconfigure Docker Trusted Registry 2.x.x to use CEPH FS mount instead of NFS and other traditional...

is 'sed' thread safe

How to make a Squid Proxy server?