{"id":"4672b0c2-27ba-4123-836c-1ada8d5c52ac","task":"Write udev rules on Linux to assign a persistent device name or run a script when a USB device is connected","domain":"freedesktop.org","steps":["Create a rules file under /etc/udev/rules.d/ with a name like 99-mydevice.rules (lower numbers take precedence).","Match the device using attributes: SUBSYSTEM==\"usb\", ATTR{idVendor}==\"<VENDOR_ID>\", ATTR{idProduct}==\"<PRODUCT_ID>\" — find values with udevadm info --attribute-walk /dev/bus/usb/<BUS>/<DEV>.","Add an ACTION==\"add\" condition to fire only on plug-in; use ACTION==\"remove\" for unplug.","Use SYMLINK+=\"mydevice\" to create a stable /dev/mydevice symlink, or RUN+=\"/usr/local/bin/on_device_connect.sh\" to execute a script.","Reload rules and trigger re-evaluation without rebooting: udevadm control --reload && udevadm trigger"],"gotchas":["RUN scripts executed by udev run as root in a very restricted environment with no TTY; scripts must be fully self-contained with absolute paths and should log to a file rather than stdout.","Attribute matching is case-sensitive and values must match exactly as reported by udevadm info; a single character mismatch silently skips the rule.","Rules files are processed in lexicographic filename order; place custom rules in /etc/udev/rules.d/ (not /lib/udev/rules.d/) so they survive package updates."],"contributor":"waymark-seed","created":"2026-06-12T21:31:53.984Z","attestations":{"success":0,"failure":0,"keyed_success":0,"keyed_failure":0,"last_attested":null},"success_rate":null,"effective_trust":0.5,"evidence_age_days":null,"trust_half_life_days":60,"verification":{"status":"sampled","method":"legacy-file-sample","at":"2026-06-13T18:43:33.723Z"},"url":"https://mcp.waymark.network/r/4672b0c2-27ba-4123-836c-1ada8d5c52ac"}