I have been using FreeNAS/TrueNAS for many years now and am quite happy with it. However now the need has arisen to automatically print PDFs from my TrueNAS server to an existing networked printer (up to date, supports all the usual protocols, fixed IP on same subnet).
I might be missing the obvious, but no matter where I google, I can’t seem to find any hints on how to go about this.
Some people suggest that I have to install CUPS on my server, but I don’t seem to be able to find instructions for that either.
Do I need to set up a jail or a VM? Sounds a bit of an overkill for just sending files to a printer (which has its own queue/spooler etc.)
This is going to be a brain dead take, but I’m sure some will agree with me: any time I spend more than 1 hour figuring out how to setup something I want on TrueNAS that isn’t built-in, I end up making a VM to do it instead. (Replace VM with docker or jail per personal preference)
If it takes me more than 2 hours to setup on a VM, I give up and use a physical machine (think obscure hardware passthrough).
While this fills me with sadness due to my occasional failures of setting up a one-stop shop, it frees up a lot of my time & sanity. It also keeps me from bastardizing my NAS too much & being plagued with inanely niche issues of my own creation.
Realistically though, I think the consensus will be that the NAS stores your files and client devices do things like print, edit, ingest, etc. I can’t imagine any enterprise customer wanting to print from their NAS vs grabbing the file & printing it from a client, hence I doubt this is a feature natively existing on TrueNAS. I could be way off the mark though, I’m sure there are dumber existing features I’m not aware of.
Just make a 2 core VM with 4 gigs of RAM to print, at least until someone smarter & less lazy than me can give you better advice on how to achieve your dreams. It’ll do the needful.
Never needed to do this (I just run a scheduled task within Windows) but you could look at the following links for ideas.
Good luck.
John
Thanks for your thoughts, much appreciated.
Just for clarification: This is a commercial installation. They receive a number of PDFs each day. These files need to be automatically printed to a networked local printer and then filed for further access (inside the server). I wouldn’t think this to be an unusual setup. The files (always PDF) just need to be ‘forwarded’ to the printer, as all the spooling etc. is already built into the printer, no need to reinvent the wheel.
Currently I use a Mac to do this job and it works just fine. Mainly for security reasons but also since the files need to end up in the server anyway I am looking into a solution that prints the files directly from the server.
From what I have gathered so far, CUPS seems to be the best solution.
Thanks John, it appears that CUPS is indeed the best option.
Meanwhile I have updated said server to TrueNAS Scale and it looks like FreeBSD no more. So I’ll look for instructions to install CUPS on Linux if there isn’t an app for TrueNAS Scale available.
TrueNAS generally doesn’t enjoy you installing things on the base OS. This might be a situation where you’d have to go into dev mode. I’d really instead recommend the lazy way of rolling a VM/Jail/Docker container.
Wouldn’t be too bad imo to have a rando linux distro vm, open a console in the VM & apt install CUPS
. With that one line (+ setup/config time) you’d be done. Safer & easier to troubleshoot than messing with the base OS. Especially since you specified this is a commercial & production environment.
If you really want it on the base install, I’ll let all the warnings on dev mode page argue on why I think it might not be optimal.
Edit:
Thanks. Makes absolute sense. See how the new system will handle it. Looks rather different from Core V.13 No more jails.
Still having that nagging feeling that this is all overkill and I am missing some basic things. Essentially I just have a file to be transferred to another IP address on the same subnet, the recipient being a printer (which already knows what to do with such a file). Why all this need for IPP/CUPS etc. on the sending side? The printer itself already does IPP etc.
For a good answer, we’d need someone with knowledge of the specifics & requirements of how a network printer functions in terms of receiving, managing, interpreting, and then printing the file along with what is required from the client system sending the task.
That knowledge could worth exploring for you, especially since this is related to your work. Then knowing the exact protocols required to make a printer actually print you could continue to figure out if base TrueNAS has them in a capacity that you could use for said purpose without modifying the base install. CUPS’ wiki page goes into some detail about why/how it does.
To me though, not being in your position, THAT sounds like overkill.
From a quick google-fu, every print server seems to basically run on CUPS. So I’m guessing there is a solid reason. Maybe it’d be better to think of CUPS as a print server (which it is) instead of just a print application. Maybe that’d help with the justification of it running in its own virtualized container.
Or maybe I’m wrong & the printer just needs an SMB share & you can dump all the PDF files into a folder with read-only access & just tell the printer to print all that crap through whatever management options are available on the printer periodically. Then, afterwards, have a script created, & run it periodically to move files from ‘to print’ folder over to ‘printed’.
I have no clue on the specifics of your printer, if that’d work, or if it’d be a better idea than CUPS.
Thank you for your take on this. Much appreciated and your logic is impeccable. I should know all this already: been in this job for a very long time.
Had to smile at your last paragraph: this is literally what I did: a shared folder on a Mac labelled ‘Incoming’ and another one labelled ‘Printed’. AppleScript would monitor the ‘Incoming’ folder, print whatever appeared in there and move it to ‘Printed’. Worked a treat for a long time.
Recently however not so well anymore. With changes in Apple’s OS and increased security requirements this is no longer reliable nor acceptable. Since we already have a rather beefy IX Server it sounds silly to have to involve another machine doing the printing.
Just curious that no one else seems to have a need for this. I use the server for all kinds of things, cronjobs galore. Totally independent of any connected computers, Windows, Mac or others.
I will dig into the details and post my results here.
Dear @Luftwaffle
I fully support your opinion that every TrueNAS Scale server should be able to do work not only for storage, but also for other tasks such as a print server for example.
I am still a rookie in the matter, but I really like the way I manage things in truenas. I already have my own nextcloud storage, a torrent client, a place to store my photo and music archives, as well as limited access to them from my home network and even from outside.
The only thing I miss for now is the ability to have a stable printer server. I have been dealing with this task for a few days now and I have some success. I got my old Usb printer to print successfully from every device at home, but I also have the following problems, which I have described at the end of this topic.
Despite everything, I hope that soon there will be official CUPS support for Truenas and everything will be fine. I really do not want to change truenas with another system, just because I cannot print.
I would also support a vote for having an official application.