[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 revisionNext revisionBoth sides next revision | ||
howtos:misc:slackware_print_server [2013/12/18 21:17 (UTC)] – General Cleanup + adding tags sycamorex | howtos:misc:slackware_print_server [2013/12/29 08:12 (UTC)] – [Making the printserver crash proof] louigi600 | ||
---|---|---|---|
Line 2: | Line 2: | ||
====== Setting up a print server for home use out of any old Slackware box ====== | ====== Setting up a print server for home use out of any old Slackware box ====== | ||
After recently upgrading my home wifi network to use wpa2 my old edimax wifi print server stopped working due to incompatibility with wpa2. | After recently upgrading my home wifi network to use wpa2 my old edimax wifi print server stopped working due to incompatibility with wpa2. | ||
- | I did not want to have to leave a PC on all the time neither did I want to directly connect | + | I did not want to have to leave a computer |
- | 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 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 13: | Line 14: | ||
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). | ||
- | Once you have these installed | + | 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 | ||
+ | |||
+ | 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 / | ||
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 23: | Line 38: | ||
or | or | ||
http:// | http:// | ||
- | | + | |
+ | For the most part you can use links on a text terminal on the print-server itself the only things that not working right on links are some combo box selections, that's why I then allowed for remote administration. | ||
Go ahead and configure the local printer as a raw printer. Be sure to check the box for a shared printer.You can call the printer whatever you like but for convenience in this guide we will call it " | Go ahead and configure the local printer as a raw printer. Be sure to check the box for a shared printer.You can call the printer whatever you like but for convenience in this guide we will call it " | ||
Line 30: | Line 46: | ||
Info test printer | Info test printer | ||
Location test location | Location test location | ||
- | DeviceURI | + | DeviceURI |
State Idle | State Idle | ||
StateTime 16147 | StateTime 16147 | ||
Line 49: | Line 65: | ||
cupsctl --share-printers --remote-any --remote-admin | cupsctl --share-printers --remote-any --remote-admin | ||
+ | | ||
+ | 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 59: | Line 79: | ||
Info test | Info test | ||
Location study room | Location study room | ||
- | MakeModel | + | MakeModel |
DeviceURI ipp://< | DeviceURI ipp://< | ||
State Idle | State Idle | ||
Line 76: | 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 | ||
+ | drwxr-xr-t | ||
+ | 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 (might have to link var/lock and maybe s few other minor issues) 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 /". | ||
====== Sources ====== | ====== Sources ====== |