Step 9Start Things and Set Permissions When Printer Connects
"nano /usr/local/etc/devd/devd.conf"
Add to the file:
# start action when USB printer ulpt0 is plugged in
# wait 3 second and then start the spooler daemon
#
attach 100 {
device-name "ulpt0";
action "sleep 3; lpd;
checkpc -f;
chown 0:0 /dev/ulpt0;
chmod 666 /dev/ulpt0;
echo 'o5L25fgfab' > /dev/speaker;";
};
*/
This watches for the printer to be plugged in, waits a few seconds, and starts the LPD process. Once that's going it fixes any missing files or permissions with checkpc -f. It then sets proper ownership and permissions on the device and plays a little sound.
| « Previous Step | Download PDFView All Steps | Next Step » |








































Thanks for the nice instruction here! (and thanks to sgrizzi as well as the original author!)
I got a problem that keeps coming back: the file permissions of the /dev/ultp0 keep changing when a printer is plugged out. This we all know that happens..
But I changed the devd.conf file (resided in /etc/devd.etc and also put it in /usr/local/etc/devd/devd.conf).
This is how it looks like:
.....
#
# This example calls a script when the AC state changes, passing the
# notify value as the first argument. If the state is 0x00, it might
# call some sysctls to implement economy mode. If 0x01, it might set
# the mode to performance.
notify 10 {
match "system" "ACPI";
match "subsystem" "ACAD";
action "/etc/acpi_ac $notify";
};
# start action when USB printer ulpt0 is plugged in
# wait 3 second and then start the spooler daemon
#
attach 100 {
device-name "ulpt0";
action "sleep 3; lpd;
checkpc -f;
chown 0:0 /dev/ulpt0;
chmod 666 /dev/ulpt0;
echo 'o5L25fgfab' > /dev/speaker;";
};
*/
END OF FILE HERE
So this should work? But it doesn't? What could be wrong here?
Any help would be appriciated!
Thanks
What's your setup like? What version of FreeNAS? Installation type?
built on - Tue Dec 15 20:12:44UTC 2009
OS Version - FreeBSD 7.2 Release-p5 revision(199506)
platform - i386 full on Intel(R) Pentium(R) 4 CPU 2.93GHz
please advice