9.10 : pkg updates/installs disappear after reboot

Status
Not open for further replies.

Aaron Snyder

Cadet
Joined
Jun 26, 2016
Messages
4
I have seen mention of this as far back as 2012, but no clear cut answer. I have the most recent stable 9.10 release installed. I am ultimately trying to install a printer on my NAS using CUPS. I start off doing "mount -uw" to mark the FS as read/write. I then go about renaming FreeBSD.conf (so pkg works) and then update it. I install CUPS, hplip and py27-pycups. After a few .conf changes I am then able to access the CUPS webpage via <device ip>:631 and go about setting up the printer. I then run "mount -ur" to mark the FS back to read only. I reboot and POOF.... all of my changes are gone. Is there a way to make my changes permanent? I'd rather not have to set up my printserver every time the power hits or I have to reboot.
 

Aaron Snyder

Cadet
Joined
Jun 26, 2016
Messages
4
So what you're saying is that I can never actually keep my system up to date. This also affects me running pkg upgrade for installed items.
 

danb35

Hall of Famer
Joined
Aug 16, 2011
Messages
15,504
I can never actually keep my system up to date.
Sure you can--install the FreeNAS system updates to do so (and if you need to manually mount the root filesystem as read-write to make changes, you're at least 18 months out of date). But no, you should not expect to be able to install or upgrade specific packages. FreeNAS is an appliance and should be treated as one.
 

Aaron Snyder

Cadet
Joined
Jun 26, 2016
Messages
4
After giving my pound of flesh to work around permissions and whatnot, I have a working printer. I pulled together several sources and will outline what I did it anyone wants to set up a jailed printserver on 9.10

Create a jail in the GUI using Advance Mode
Give it a name
Set a static IP
Set the default gateway
uncheck vimage

SSH to the NAS

jls
find the ID for your jail
jexec <jailID> sh
pkg update
portsnap fetch
portsnap extract
pkg install cups hplip py27-pycups foo2zjs wget gutenprint-cups
cd /usr/local/etc/cups
mv cupsd.conf cupsd.conf.org
wget https://www.dropbox.com/s/744pdquxsx5busq/cupsd.conf
echo "[system=10]" >> /etc/devfs.rules
echo "add path 'unlpt*' mode 0660 group cups" >> /etc/devfs.rules
echo "add path 'ulpt*' mode 0660 group cups" >> /etc/devfs.rules
echo "add path 'lpt*' mode 0660 group cups" >> /etc/devfs.rules
echo "add path 'usb*' mode 0770 group cups" >> /etc/devfs.rules
echo "add path 'ugen*' mode 0660 group cups" >> /etc/devfs.rules
echo "cupsd_enable="YES"" >> /etc/rc.conf
echo "cupsd_program="/usr/local/sbin/cupsd" >> /etc/rc.conf
echo "# change permissions in jail for printer" >> /etc/rc.conf
echo "chmod -R 0770 /dev/usb*" >> /etc/rc.conf
echo "chmod -R 0660 /dev/ugen*" >> /etc/rc.conf
echo "chmod -R 0660 /dev/unlpt*" >> /etc/rc.conf
echo "chmod -R 0660 /dev/ulpt*" >> /etc/rc.conf
echo "chown -R root:cups /dev/ugen*" >> /etc/rc.conf
echo "chown -R root:cups /dev/usb*" >> /etc/rc.conf
echo "chown -R root:cups /dev/unlpt*" >> /etc/rc.conf
echo "chown -R root:cups /dev/ulpt*" >> /etc/rc.conf
/etc/rc.d/devfs restart
service cupsd restart


You should now be able to access the CUPS page at <jailIPaddress>:631. Click the Administration link. If all went well your printer should be listed (one of them having HPLIP in the name). Choose it and click Next. Give your printer a name (I used hplj1020. This will be used when connecting from your workstation). Click the check box for Share This Printer at the bottom and click Continue. In the Model list you should have one with Foomatic/foo2zjs-z1 in the name. Highlight that and click Add Printer. The next screen will list your printer options. You can generally click Set Default Options.


I can only speak to Windows machines, but to set this up in Win10 pull up devices and printers. Click Add a printer. You don't need to wait for the search to finish, just click "The printer that I want isn't listed" on the bottom left of the search window. Click the radio button for "Select a shared printer by name" and enter http://<jailIPaddress>:631/printers/<YourPrinterName> then click Next. Choose the make and model of your printer in the Add Printer Wizard (or click Have Disk and then select the INF if you have downloaded drivers from the maker) and click Next. You will have successfully connected so click Finish.

Hope this helps.
 
Last edited:
Status
Not open for further replies.
Top