Errata on a Project to Install CUPS

Status
Not open for further replies.
Joined
Jan 19, 2012
Messages
11
Hello, everyone,
I recently embarked to install CUPS on my FreeNAS to provide AirPrint functionality for my network printer. I've posted the steps I took over on SuperUser.org. The project was a success, but I've noticed a few problems I was hoping someone here might have found a resolution to. Once I resolve these, I figured I would polish up my documented steps and post a how-to online to help anyone else that might be interested in doing this.

First, I ended up needing to add the Bonjour/ZeroConf information to the main system Avahi installation, rather than running a separate copy in the jail. Perhaps this is for the best, but it did leave me curious: Avahi within the jail would only work for a few minutes before mysteriously ceasing to advertise services. Any idea why?

Second, unlike a normal, generic CUPS installation (such as the one I did just the day before on Arch Linux), the copy I installed on FreeNAS seems incapable of auto detecting CUPS-compatible printers on the network under its auto detection section. Is this somehow tied in with the Avahi issue?

Last, but not least, now that I have a jail on a separate IP address, Avahi is advertising both IP addresses for all of the network services. This presents a problem in certain instances: for example, when I try to ssh into beatrice.local, I end up connecting to my jail's SSH server rather than the systemwide one. I've had to switch to using the static IP to ensure I connect to the overall FreeNAS system. Any idea on how to fix this?

Thanks,
Tim
 
Joined
Jan 19, 2012
Messages
11
OK, I have an update on this: when I restart the system, the Avahi configuration I put in the root system appears to be cleared (perhaps Avahi's configuration is regenerated every time the system starts?). Is there any way to avoid having it deleted?

Also, if anyone has comments on the other points, I'd still appreciate feedback. I'm not sure if this is useful to anyone else, but I had seen numerous questions about setting up AirPrint, but no answers, so I hope my little step-by-step installation process might prove helpful to others once I fix the bugs.
 

jgreco

Resident Grinch
Joined
May 29, 2011
Messages
18,681
Yes, most configuration files are not persistent and are either generated or in some cases copied. I'm on a cell phone so determining which isn't convenient...
 

Clark Kent

Cadet
Joined
Aug 16, 2012
Messages
2
Hello Timothy R. Butler,

Where I work, we have the FreeNas 8.3.0 working normally, and I would like install the CUPS to manage around 6 Network Printers.

Do you have idea about the stability of this installation (CUPS on FreeNAS). Is working normally for you? Any situation, or condition that I need take careful?

We have here around 120 machines (90% Windows platform), and all of these machines will use the CUPS installed in the FreeNAS as a printer server.

DO you see any problem?

Thank so much for your help and sorry for my bad English =).

Regards
 
Joined
Jan 19, 2012
Messages
11
@jgreco, thanks, I had a feeling that might be the case. Any suggestions on how to add something to the tool that does the auto-generation?

@Clark Kent, so far, it has been very stable for me. It is well worth a try, I would say. The only issue is the aforementioned one, that seems to be getting in the way of proper Bonjour/ZeroConf auto discovery. If that isn't needed, I'd say you should be good to go right away.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
OK, I have an update on this: when I restart the system, the Avahi configuration I put in the root system appears to be cleared (perhaps Avahi's configuration is regenerated every time the system starts?). Is there any way to avoid having it deleted?
/etc is a ramdisk, so it is recreated on every reboot. The base avahi files are copied from here: /conf/base/etc/local/avahi. The service files are created by the respective service rc "config" scripts: ix-afpd, ix-samba, ix-ssh (they run from /etc/rc.d, the persistent copies are in /conf/base/etc/rc.d).
 
Joined
Jan 19, 2012
Messages
11
Interesting. Thanks @Dusan. So, if I want to have the service be persistent, I should create a new ix-cups file in /conf/base/etc/rc.d?
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
Not really, because nothing would be calling your script. The ix-* scripts do much more than just configure avahi -- the GUI calls them when you enable/disable the respective services. You could write a proper rc script and also edit rc.conf to enable it, but that may be too much hassle (for more details see her: http://www.freebsd.org/cgi/man.cgi?query=rc)
If your avahi config is static then just add the service file to /conf/base/etc/local/avahi/services. If it needs to be generated then I suggest you do it in whatever script you use to launch CUPS. Or, wait for 9.2.0 -- it consolidates the avahi configuration into one ix_avahi script.
 
Joined
Jan 19, 2012
Messages
11
I tried to do as you said, unfortunately, it says that /conf/base/etc/local/avahi/services is on a read-only file system. I'm guessing maybe the root mount point isn't read/write? Am I missing something?

Thanks for your help!
 

cyberjock

Inactive Account
Joined
Mar 25, 2012
Messages
19,526
I tried to do as you said, unfortunately, it says that /conf/base/etc/local/avahi/services is on a read-only file system. I'm guessing maybe the root mount point isn't read/write? Am I missing something?

Thanks for your help!

You are.. check out the manual or FAQ.. that explains what you are doing wrong.
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
I tried to do as you said, unfortunately, it says that /conf/base/etc/local/avahi/services is on a read-only file system. I'm guessing maybe the root mount point isn't read/write? Am I missing something?
Yes, the root file system is read only. If you know what you are doing it is possible to override that, but it is not recommended. In your case I suggest you add a Post Init Script to create/copy the file in(to) /etc/local/avahi/services on every system startup. The script may also need to run "service avahi-daemon restart" to restart avahi.
 
Joined
Jan 19, 2012
Messages
11
Very nice, thanks, Dusan! Do you see any problem with setting it as a pre-init Script, instead? I've been fiddling and that seems to work (and avoids copying it after Avahi starts), but I wasn't sure if there would be a problem I'm not thinking about. I really appreciate your help, in any case -- AirPrint is persistent on my FreeNAS box!
 

Dusan

Guru
Joined
Jan 29, 2013
Messages
1,165
I suggested a post-init script so that the pools are mounted in case you need to copy/access something there. However, if your solution works with a pre-init script that's great, there should be no problem.
 
Joined
Jan 19, 2012
Messages
11
Great. Thank you again! I'm very excited to have this all working. It's a pretty nifty way to add some extra functionality to my FreeNAS box.

(Incidentally, I updated my step-by-step instructions in case anyone else would want to follow the same procedure.)
 
Status
Not open for further replies.
Top