I'm trying to write a udev rule to hook up my Christmas present to my computer.<div><br></div><div>The /dev/legonxt symlink (see rule) is never created, and the /tmp/legonxt.called file (see script) is never created.</div>
<div><br></div><div>Any ideas?</div><div><div><br></div><div>----- details ------</div><div><br></div><div>udevadm info tells me this:</div><div><div>$ udevadm info -a -p /sys/devices/LNXSYSTM\:00/</div><div><cut some plain text...></div>
<div><br></div><div> looking at device '/devices/LNXSYSTM:00':</div><div> KERNEL=="LNXSYSTM:00"</div><div> SUBSYSTEM=="acpi"</div><div> DRIVER==""</div><div> ATTR{path}=="\"</div>
<div> ATTR{hid}=="LNXSYSTM"</div><div> ATTR{modalias}=="acpi:LNXSYSTM:"</div></div><div><br></div><div><br></div><div>I've got this in /etc/udev/rules.d/90-legonxt.rules:</div><div>SUBSYSTEM=="acpi", ATTR{hid}=="LNXSYSTM", SYMLINK+=”legonxt”, ACTION=="add", RUN+=”/etc/udev/legonxt.sh”</div>
<div><br></div><div>The shell file:</div><div><br></div><div><div>$ ls -l /etc/udev/legonxt.sh </div><div>-rwxr-xr-x 1 root root 327 2010-12-26 10:35 /etc/udev/legonxt.sh</div></div><div><br></div><div>$ cat /etc/udev/legonxt.sh</div>
<div><div>#!/bin/bash</div><div><br></div><div>echo "Called legonxt.sh ..." >> /tmp/legonxt.called</div><div>echo " ACTION=[${ACTION}]" >> /tmp/legonxt.called</div><div>echo " DEVICE=[${DEVICE}]" >> /tmp/legonxt.called</div>
<div><br></div><div>GROUP=plugdev</div><div>if [ "${ACTION}" = "add" ] &amp;&amp; [ -f "${DEVICE}" ]</div><div>then</div><div> chmod o-rwx "${DEVICE}"</div><div> chgrp "${GROUP}" "${DEVICE}"</div>
<div> chmod g+rw "${DEVICE}"</div><div>fi</div></div></div><div><br></div><div><br></div><div><br></div><div>Thanks,</div><div><br></div><div>Chris</div>