[2024-feb-29] Sad news: Eric Layton aka Nocturnal Slacker aka vtel57 passed away on Feb 26th, shortly after hospitalization. He was one of our Wiki's most prominent admins. He will be missed.
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
howtos:misc:slackware_print_server [2013/12/20 08:20 (UTC)] – [Setting up a print server for home use out of any old Slackware box] louigi600 | howtos:network_services:slackware_print_server [2014/12/18 02:04 (UTC)] (current) – howtos:misc:slackware_print_server renamed to howtos:network_services:slackware_print_server (Moved to network services) mfillpot | ||
---|---|---|---|
Line 4: | Line 4: | ||
I did not want to have to leave a computer on all the time neither did I want to directly connect whatever PC I need to print from to the printer itself. | I did not want to have to leave a computer on all the time neither did I want to directly connect whatever PC I need to print from to the printer itself. | ||
- | The most elegant solution would have been to setup some low power ARM device (naturally running Slackware ARM) to become a print server. | + | The most elegant solution would be to setup some low power ARM device (naturally running Slackware ARM) to become a print server, but any old hardware that can run Slackware linux will be fine and if you're willing to stick up with alternative distributions I suppose any hardware that can run linux will do. |
- | I know it's not a difficult thing but since the last time I did something like this a lot of things have changed, I thought that other people could benefit from a quickstart to get going really fast ... so here we go: | + | |
+ | I know it's not a difficult thing but since the last time I did something like this a lot of things have changed, I thought that other people could benefit from a quickstart to get going really fast ... so here we go: (the steps blow assume that networking has already been setup correctly on all participants) | ||
===== Setting up the printer on the print server | ===== Setting up the printer on the print server | ||
Line 14: | Line 15: | ||
The printer server will need cups, cyrus-sasl and openssl packages (openssl is only mandatory if you wish to remotely administer cups). | The printer server will need cups, cyrus-sasl and openssl packages (openssl is only mandatory if you wish to remotely administer cups). | ||
If your printer has a usb interface, like most currently, it will be necessary to also have these packages to assist the usblp kernel module: | If your printer has a usb interface, like most currently, it will be necessary to also have these packages to assist the usblp kernel module: | ||
- | libusb, libusb-compat and usbutils. Once the packages are installed if you then plug in the printer udev should automatically load usblp kernel module and lsusb should list, possibly amongst other things, your printer. | + | libusb, libusb-compat and usbutils. Once the packages are installed if you then plug in the printer udev should automatically load usblp kernel module and lsusb should list, possibly amongst other things, your printer. |
+ | |||
+ | root@printserver: | ||
+ | Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub | ||
+ | Bus 001 Device 002: ID 05e3:0608 Genesys Logic, Inc. USB-2.0 4-Port HUB | ||
+ | Bus 001 Device 003: ID 0bda:0119 Realtek Semiconductor Corp. Storage Device (SD card reader) | ||
+ | Bus 001 Device 004: ID 0ace:1211 ZyDAS ZD1211 802.11g | ||
+ | Bus 001 Device 005: ID 04e8:3260 Samsung Electronics Co., Ltd CLP-510 Color Laser Printer | ||
+ | root@printserver: | ||
+ | |||
+ | If you can see something similar to this, where your printer is detected by lsusb, you can proceed otherwise you need to debug the reasons that are preventing your printer from being detected. | ||
+ | |||
Once you have the packages and printer sorted out you can then just give execute permissions to / | Once you have the packages and printer sorted out you can then just give execute permissions to / | ||
If you intend to remotely administer it you might like to execute this command to allow it: | If you intend to remotely administer it you might like to execute this command to allow it: | ||
Line 54: | Line 67: | ||
| | ||
If you're not interested to share the printer to outside your Local Area Net just remove the " | If you're not interested to share the printer to outside your Local Area Net just remove the " | ||
+ | |||
+ | Some hardware platforms leave you no way to do a clean shutdown without interacting to the os running on it (like old AT PC or seagate dockstar). You can work around this problem by making a udev rule that executes a shutdown when the printer is removed (unplugged or turned off) so that when you're done printing, you turn off the printer, the print-server would shutdown along too without crashing. | ||
| | ||
===== Setting up the printer on the print clients | ===== Setting up the printer on the print clients | ||
Line 81: | Line 96: | ||
You may now try printing a test page on the client PC. | You may now try printing a test page on the client PC. | ||
+ | ===== Making the printserver crash proof ===== | ||
+ | Once you have your print server working right you will probably want avoid doing anything to it unless it's really necessary. Looking after it's shutting down right and resolving fsck issues on reboot should not be something to worry about but journaled filesystems are meant to deal with accidental power rages not really for you to crash the system every time you switch it off. | ||
+ | |||
+ | Having the root filesystem mounted read only, with only the parts that are necessary for writing linked into tmpfs, would free us form having to worry about powering down the print server. | ||
+ | |||
+ | This is how I modified rc.S and rc.M for the job: | ||
+ | |||
+ | |||
+ | rc.S.org | ||
+ | rc.S 2013-12-28 14: | ||
+ | @@ -18,12 +18,31 @@ | ||
+ | fi | ||
+ | fi | ||
+ | fi | ||
+ | +echo " | ||
+ | +echo " | ||
+ | +echo " | ||
+ | |||
+ | +# | ||
+ | if [ -d /run ]; then | ||
+ | if ! grep -wq "tmpfs /run tmpfs" / | ||
+ | / | ||
+ | fi | ||
+ | fi | ||
+ | +( cd /run | ||
+ | + / | ||
+ | + / | ||
+ | + for DIR in packages removed_packages removed_scripts scripts setup | ||
+ | + do | ||
+ | + /usr/bin/ln -s / | ||
+ | + done | ||
+ | + /usr/bin/ln -s / | ||
+ | + / | ||
+ | +) | ||
+ | | ||
+ | |||
+ | # Load the loop device kernel module: | ||
+ | if [ -x / | ||
+ | @@ -219,32 +238,32 @@ | ||
+ | | ||
+ | fi | ||
+ | # Remount the root filesystem in read-write mode | ||
+ | - echo " | ||
+ | - /sbin/mount -w -v -n -o remount / | ||
+ | - if [ $? -gt 0 ] ; then | ||
+ | - echo | ||
+ | - echo " | ||
+ | - echo "cause serious problems." | ||
+ | - echo | ||
+ | - echo "If you're using the UMSDOS filesystem, you **MUST** mount the root partition" | ||
+ | - echo " | ||
+ | - echo " | ||
+ | - echo | ||
+ | - echo " | ||
+ | - echo | ||
+ | - echo " | ||
+ | - echo | ||
+ | - | ||
+ | - echo | ||
+ | - echo "You can also get into your system by using a boot disk with a command like this" | ||
+ | - echo "on the LILO prompt line: (change the root partition name as needed)" | ||
+ | - echo | ||
+ | - echo "LILO: mount root=/ | ||
+ | - echo | ||
+ | - echo " | ||
+ | - echo -n "get into your machine and start looking for the problem. " | ||
+ | - read junk; | ||
+ | - fi | ||
+ | +# echo " | ||
+ | +# /sbin/mount -w -v -n -o remount / | ||
+ | +# if [ $? -gt 0 ] ; then | ||
+ | +# echo | ||
+ | +# echo " | ||
+ | +# echo "cause serious problems." | ||
+ | +# echo | ||
+ | +# echo "If you're using the UMSDOS filesystem, you **MUST** mount the root partition" | ||
+ | +# echo " | ||
+ | +# echo " | ||
+ | +# echo | ||
+ | +# echo " | ||
+ | +# echo | ||
+ | +# echo " | ||
+ | +# echo | ||
+ | +# echo "rdev -R /dev/fd0 0" | ||
+ | +# echo | ||
+ | +# echo "You can also get into your system by using a boot disk with a command like this" | ||
+ | +# echo "on the LILO prompt line: (change the root partition name as needed)" | ||
+ | +# echo | ||
+ | +# echo "LILO: mount root=/ | ||
+ | +# echo | ||
+ | +# echo " | ||
+ | +# echo -n "get into your machine and start looking for the problem. " | ||
+ | +# read junk; | ||
+ | +# fi | ||
+ | else | ||
+ | echo " | ||
+ | echo | ||
+ | --- rc.M.org | ||
+ | +++ rc.M 2013-12-28 14: | ||
+ | @@ -17,7 +17,7 @@ | ||
+ | # Update all the shared library links: | ||
+ | if [ -x / | ||
+ | echo " | ||
+ | - / | ||
+ | + / | ||
+ | fi | ||
+ | |||
+ | # Screen blanks after 15 minutes idle time, and powers down in one hour | ||
+ | |||
+ | A bit of tinkering with links in var and a few other places and you're done. | ||
+ | |||
+ | root@printserver: | ||
+ | total 0 | ||
+ | lrwxrwxrwx | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | lrwxrwxrwx | ||
+ | lrwxrwxrwx | ||
+ | lrwxrwxrwx | ||
+ | drwxr-xr-x 12 root root 800 Nov 25 1993 man/ | ||
+ | lrwxrwxrwx | ||
+ | lrwxrwxrwx | ||
+ | lrwxrwxrwx | ||
+ | drwxr-xr-x | ||
+ | drwxr-xr-x | ||
+ | lrwxrwxrwx | ||
+ | root@printserver: | ||
+ | lrwxrwxrwx 1 root root 16 Jan 1 01:06 / | ||
+ | root@printserver: | ||
+ | total 40 | ||
+ | -rw-r--r-- 1 root root 0 Jan 1 01:00 cron | ||
+ | drwxr-xr-x 2 root root 100 Jan 1 01:01 cups/ | ||
+ | -rw-r--r-- 1 root root 1280 Jan 1 01:01 debug | ||
+ | -rw-r--r-- 1 root root 11512 Jan 1 01:00 dmesg | ||
+ | -rw-r--r-- 1 root root 0 Jan 1 01:00 maillog | ||
+ | -rw-r--r-- 1 root root 19290 Jan 1 01:06 messages | ||
+ | drwxr-xr-x 2 root root 40 Jan 1 01:00 nfsd/ | ||
+ | lrwxrwxrwx 1 root root 20 Jan 1 01:00 packages -> / | ||
+ | lrwxrwxrwx 1 root root 28 Jan 1 01:00 removed_packages -> / | ||
+ | lrwxrwxrwx 1 root root 27 Jan 1 01:00 removed_scripts -> / | ||
+ | drwxr-xr-x 2 root root 40 Jan 1 01:00 samba/ | ||
+ | lrwxrwxrwx 1 root root 19 Jan 1 01:00 scripts -> / | ||
+ | -rw-r--r-- 1 root root 0 Jan 1 01:00 secure | ||
+ | lrwxrwxrwx 1 root root 17 Jan 1 01:00 setup -> / | ||
+ | -rw-r--r-- 1 root root 0 Jan 1 01:00 spooler | ||
+ | -rw-r--r-- 1 root root 2083 Jan 1 01:01 syslog | ||
+ | root@printserver: | ||
+ | total 0 | ||
+ | lrwxrwxrwx 1 root root 16 Jan 1 01:00 cron -> / | ||
+ | drwx--x--- 3 root lp 60 Jan 1 01:00 cups/ | ||
+ | drwxr-xr-x 2 root root 40 Jan 1 01:00 mail/ | ||
+ | root@printserver: | ||
+ | lrwxrwxrwx 1 root root 7 Jan 1 01:03 /tmp -> run/tmp/ | ||
+ | root@printserver: | ||
+ | proc on /proc type proc (rw, | ||
+ | sysfs on /sys type sysfs (rw, | ||
+ | tmpfs on /run type tmpfs (rw, | ||
+ | devtmpfs on /dev type devtmpfs (rw, | ||
+ | /dev/ubi0_0 on / type ubifs (ro, | ||
+ | devpts on /dev/pts type devpts (rw, | ||
+ | cgroup on / | ||
+ | root@printserver: | ||
+ | | ||
+ | With these links the Slackware distribution will operate pretty much normally and can resume to ordinary operation by just remounting root read/write "mount -o remount,rw /" to allow some maintenance (like package management) and when that's done just remount it ro with a simple "mount -o remount,ro /". | ||
+ | ===== Here's my wifi print server | ||
+ | Here's one of my Dockstars in a homebrew casing running the above described printserver from internal flash. (the usb stick on top is a wifi stick) | ||
+ | {{http:// | ||
====== Sources ====== | ====== Sources ====== |