3 Simple Ways to
Share What You Make

With Instructables you can share what you make with the world — and tap into an ever-growing community of creative experts.

PhotosPhotos

Share one or more photos of a project, recipe, or whatever you've made, quickly and easily.

Step by StepStep-By-Step

Share your step-by-step photos with text instructions of what you made so others can do it too!

VideoVideo

Share your how-to video. You'll need your embed code from a video site such as YouTube.

FreeNAS as a Print Server

Step 9Start Things and Set Permissions When Printer Connects

We're going to want to start up the proper LPRng processes when a printer is connected. Type:

"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 StepDownload PDFView All StepsNext Step »
8 comments
Jun 25, 2010. 11:07 AMmebkopcznski says:
Even puting the commands in this file /etc/devd.conf (because version 7.1 doesn't have the one informed in instructions), i don't get printer working after reboot. I'm looking for a place where I can put this command. Any ideia?
Feb 22, 2010. 9:40 PMpeephuhpeep says:

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?

Apr 13, 2010. 8:51 AMbboudewijns says:
I have exactly the same problem. If i chmod and chown manually the printer is working fine, but the devd.conf is not loaded at boot indeed. I dont get it. Dont here the sound as wel...

Any help would be appriciated!

Thanks
Jan 28, 2010. 12:42 PMnadhs says:
 Well I don't have this file or directory under /usr/local/etc/
Jan 29, 2010. 7:33 AMnadhs says:
 Please advise what I need to do in this case ?
Feb 3, 2010. 9:02 PMnadhs says:
verison - 0.7.1 shere (revision4944)
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
Feb 12, 2010. 11:37 PMzhg says:
look for the file under /etc/devd.conf

Pro

Get More Out of Instructables

Already have an Account?

close

All Steps Viewing
View all steps of an Instructable on the same page when you're a Pro Member.

Upgrade to Pro today!
3
Followers
1
Author:Tau_Zero(Napkin Diagrams)
Twitter: @Tau_Zero