From owner-freebsd-questions@freebsd.org Mon Jan 23 07:59:52 2017 Return-Path: Delivered-To: freebsd-questions@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id C2E7ACBC67D for ; Mon, 23 Jan 2017 07:59:52 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mailrelay12.qsc.de (mailrelay12.qsc.de [212.99.163.153]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "*.antispameurope.com", Issuer "TeleSec ServerPass DE-2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 487A47D for ; Mon, 23 Jan 2017 07:59:51 +0000 (UTC) (envelope-from freebsd@edvax.de) Received: from mx01.qsc.de ([213.148.129.14]) by mailrelay12.qsc.de; Mon, 23 Jan 2017 09:02:44 +0100 Received: from r56.edvax.de (port-92-195-83-137.dynamic.qsc.de [92.195.83.137]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by mx01.qsc.de (Postfix) with ESMTPS id C53D43CC56; Mon, 23 Jan 2017 08:59:41 +0100 (CET) Received: from r56.edvax.de (localhost [127.0.0.1]) by r56.edvax.de (8.14.5/8.14.5) with SMTP id v0N7xeW7002558; Mon, 23 Jan 2017 08:59:41 +0100 (CET) (envelope-from freebsd@edvax.de) Date: Mon, 23 Jan 2017 08:59:40 +0100 From: Polytropon To: David Christensen Cc: freebsd-questions@freebsd.org Subject: Re: FreeBSD 11, Xfce, and printing Message-Id: <20170123085940.0f118df2.freebsd@edvax.de> In-Reply-To: References: <114d072f-9fc4-e513-90fb-409e7e277afd@holgerdanske.com> <20170123075307.89b4e6f4.freebsd@edvax.de> Reply-To: Polytropon Organization: EDVAX X-Mailer: Sylpheed 3.1.1 (GTK+ 2.24.5; i386-portbld-freebsd8.2) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-cloud-security-sender: freebsd@edvax.de X-cloud-security-recipient: freebsd-questions@freebsd.org X-cloud-security-Virusscan: CLEAN X-cloud-security-disclaimer: This E-Mail was scanned by E-Mailservice on mailrelay12.qsc.de with 65F396B8C6D X-cloud-security-connect: mx01.qsc.de[213.148.129.14], TLS=1, IP=213.148.129.14 X-cloud-security: scantime:.3617 X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 23 Jan 2017 07:59:52 -0000 On Sun, 22 Jan 2017 23:29:25 -0800, David Christensen wrote: > On 01/22/17 22:53, Polytropon wrote: > > On Sun, 22 Jan 2017 19:50:37 -0800, David Christensen wrote: > >> I wanted to print a document today. I went looking for: > >> > >> Application Menu -> Settings -> Printing > >> > >> > >> It does not exist. All I see is: > >> > >> Application Menu -> Settings -> Xfce 4 Printing System Settings > >> > >> > >> CUPS is missing from the left-hand pane. > > > > Is CUPS installed > > Thanks for the reply. > > > Apparently, yes: > > toor@freebsd:/root # pkg info cups | head -n 4 > cups-2.2.1 > Name : cups > Version : 2.2.1 > Installed on : Mon Jan 16 15:57:43 2017 PST Good. It's simply worth checking out the fundamental steps for printing, so _that_ cannot be the problem. :-) > > and enabled? > > > How is CUPS enabled? No, wait, let me guess -- /etc/rc.conf? Correct: cupsd_enable="YES" will do the trick. In order to get the permission stuff right, devfs_system_ruleset="system" will also be needed. > But, is it running? > > toor@freebsd:/root # ps -A | grep -i cups > 13962 0 R+ 0:00.00 grep -i cups > > > Apparently, yes. Apparently, no. Read with attention: You are seeing the grep (!) process (searching for the word "cups"), not CUPS itself. As root: # ps ax | grep "cupsd" 1725 ?? Is 0:00.77 /usr/local/sbin/cupsd -C /usr/local/etc/cups/cupsd.conf 2543 2 S+ 0:00.00 grep cupsd The first line indicates the actual CUPS daemon running. > STFW yields some hits: > > 1. This one mentions /etc/rc.conf (lucky guess). And other stuff. I > wonder if it is applicable to FreeBSD 11.0, or will I screw up my system? > > https://www.freebsd.org/doc/en/articles/cups/article.html > > Last modified on 2015-04-04 23:31:59Z by eadler. > > Next, add two lines to /etc/rc.conf as follows: > > cupsd_enable="YES" > devfs_system_ruleset="system" That is correct. > > Open a web broser and go to http://localhost:631, this is the > > web configuration interface for CUPS, the preferred method to > > interact with the beast. :-) > > Unable to connect > > Firefox can’t establish a connection to the server at localhost:631. You usually get this message if CUPS is _not_ running, or if networking is a little bit messed up. Check a few things: Does /etc/hosts have a line for localhost? Can you connect to 127.0.0.1:631? > I guess that confirms CUPS is not configured correctly. I think so, too. > > It seems that Xfce doesn't have a proper integration for CUPS, > > at least the FreeBSD version hasn't. > > Works OOTB on Debian 7. That's why I said _FreeBSD_ version. Note that Xfce is ported to FreeBSD from Linux, and those are different operating systems. > >> So, I installed: > >> > >> xfce4-print > >> > >> > >> Which said: > >> > >> ===> NOTICE: > >> > >> This port is deprecated; you may wish to reconsider installing it: > >> > >> Depends on unmaintained x11-toolkits/libxfce4gui. > > > > Then don't use it. It isn't required anyway. Use the web > > interface instead as suggested in the CUPS documentation. > > I prefer Xfce Application Menu -> Settings -> Printing. No matter what _you_ prefer, CUPS prefers the web interface, so you should better do what the software wants you to do. ;-) You can easily add a menu item that opens the default web browser with the CUPS web interface. Note that you can also use CLI tools like lpadmin for the printer configuration, but personally I find them rather inconvenient for a "do once, then forget" kind of task. > >> Application Menu -> Settings -> Printing still does not exist, and the > >> LibreOffice Writer Print dialog still does not look encouraging. > > > > OpenOffice has a stand-alone printer management tool symlink > > called /usr/local/bin/openoffice.org-3.3.0-spadmin, and > > LibreOffice has something similar; search for "spadmin", > > that will be the right one. > > > > First configure CUPS using the web interface, then run that > > program to make LO aware of the printer. It should work then. > > I prefer Xfce Application Menu -> Settings -> Printing. CUPS doesn't. :-) > > The last time I configured CUPS + LO printing was more than > > 3 years ago, and I forgot everything... ;-) > > That's why I take a lot of notes and put them into CVS. I also usually do this, but due to "human pressure" I didn't do it at _that_ time when I got the impossible working (two crappy USB printers with CUPS). I know there are some hand- written notes somewhere, but I can't find them at the moment. It's the kind of stuff you need every 5-10 years just to discover that your notes are outdated and don't work anymore with current systems. :-) > >> Any suggestions for getting CUPS working? > > > > Allow me to point you to the relevant sources: > > > > https://www.freebsd.org/doc/handbook/printing.html > > > > https://www.freebsd.org/doc/en/articles/cups/ > > > > http://www.wonkity.com/~wblock/docs/html/lpdprinting.html > > The first and third appear to cover old-school printing. Well, I find system lpd + printer filter very appealing when it comes to real printers (that understand PS). It's so much easier, no web interface needed, works without trouble all the time - but heavily depends on the printer. > The second is one I also found STFW. It looks like the best of them > all. I guess I'll give it a try. It more or less tells you to go to localhost:631 and follow the instructions there. :-) > > (Hopefully) helpful sidenote: > > > > Make yourself familiar with the CUPS commands lpq, lpr, lprm, > > cupsaccept, and cupsenable. Check the location of the CUPS > > log files in /var/log, especially the error log file. It will > > significantly help you at troubleshooting. > > > > What you should get when you've configured everything correctly, > > for example: > > > > % lpq > > Laserjet is ready > > no entries > > > > % lpr import.pdf > > % lpq > > Laserjet is ready and printing > > Rank Owner Job File(s) Total Size > > active poly 4929 import.pdf 73728 bytes > > > > The web interface also has the ability to check those (as well > > as partial error messages in case the printer doesn't print), but > > using the CLI tools is much more convenient. > > I'll keep that handy. A few other commands that you might note: lpadmin, lpstat, lpinfo. When you've done your configuration right, i. e. printer is installed, enabled, accepts jobs, the CLI tools should tell you that quickly (other than "^P + trial & error + web browser"). :-) PS. Remember the LibreOffice printer setup. If I remember correctly, this step is also required. -- Polytropon Magdeburg, Germany Happy FreeBSD user since 4.0 Andra moi ennepe, Mousa, ...