# Printer not working after upgrading CUPS



## ndelmonico (Apr 11, 2014)

I know others seem to have solved their problems with the new CUPS, but not I.  My printer was working fine before the upgrade and now it doesn't.  What has changed?  The print jobs just sit in queue and never print.  Here are some of the messages that appear in the error log:


```
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open device file: Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open command file - : Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open device file: Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open device file: Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open command file - : Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open command file - : Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open device file: Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open command file - : Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open device file: Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open command file - : Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open device file: Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open command file - : Permission denied
E [10/Apr/2014:22:15:42 -0500] [Job 151] Unable to open device file: Permission denied
```

When I restart the `devfs` program to make the printer available I get this puzzling message:


```
chown: users: illegal group name
chown: users: illegal group name
chown: users: illegal group name
chown: users: illegal group name
```

The cups group does not seem to be recognized though it is there in the group file under /etc.

My spool directory (/var/spool/cups/) looks like this:


```
-rw-------  1 root  cups      674 Apr  9 21:32 c00148
-rw-------  1 root  nobody    916 Apr 10 20:49 c00149
-rw-------  1 root  cups      735 Apr  9 21:55 c00150
-rw-------  1 root  nobody    742 Apr 10 22:21 c00151
-rw-------  1 root  nobody    775 Apr 10 21:08 c00152
-rw-------  1 root  nobody    650 Apr 10 22:05 c00153
-rw-r-----  1 root  cups       32 Apr  9 21:31 d00148-001
-rw-r-----  1 root  cups    45609 Apr  9 21:53 d00149-001
-rw-r-----  1 root  cups    64518 Apr  9 21:55 d00150-001
-rw-r-----  1 root  nobody     32 Apr 10 20:46 d00151-001
-rw-r-----  1 root  nobody     32 Apr 10 20:46 d00152-001
-rw-r-----  1 root  nobody    234 Apr 10 22:05 d00153-001
-rw-------  1 root  cups     1012 Apr  8 22:23 lpr
drwx--x--T  2 root  cups      512 Apr  4 23:49 tmp
```

Instead of assigning cups as the user nobody gets assigned.  I suppose this is why I get the error message: Unable to open device file: Permission denied.  Using `chown` and `chmod` on the files in the spool does not seem to help.  Nothing gets printed.  

I have fiddled with this problem for a couple of days now and cannot figure out how to fix it.  Does anyone have an idea what may be going on here? I can't figure out what has changed.

Thanks.

Neal


----------



## Chris_H (Apr 11, 2014)

You might want to have a look at /etc/passwd, and /etc/group. See also adduser(8), and vipw(8). My suspicion is that mergemaster(8) either wasn't run correctly, or run at all during/after your upgrade. Point being; if the `cups` user, or group wasn't added/updated. Then you'll have this exact problem. See if the user/group exists in the 2 files I referenced above. Also have a look at /var/tmp/temproot/etc for the patch(es) that would have been applied/merged. Had mergemaster(8) done it's job properly.

--Chris


----------



## ndelmonico (Apr 11, 2014)

Thanks for your suggestions,  I have checked /etc/group and /etc/passwd and `cups` is in both.  I ran `vipw(8)` and `mergemaster(8)` but the problem remains.  There does not seem to be anything in /var/tmp/temproot/etc.  The new version of cups-filters does not seem to help either.

Best

Neal


----------



## Chris_H (Apr 11, 2014)

OK. While I don't have CUPS server installed, and I'm on releng_8, and releng_9. As I look through the source of /usr/ports/print/cups-base. I see the following, which seems pertinent to the issue you describe

```
2) And following to /etc/rc.conf:

devfs_system_ruleset="system"

3) Restart devfs: /etc/rc.d/devfs restart

If your system supports 'devd' you can copy
$PREFIX/share/examples/cups/ulpt-cupsd.conf to $PREFIX/etc/devd/

To enable printing under Gimp and MS-Windows clients do the following:

1) Uncomment application/octet-stream line in mime.types
2) Uncomment application/octet-stream line in mime.convs
3) Restart cupsd

If you are using libusb, it is important that no device driver, e.g.
ulpt(4) is attached to the device you wish to use. In this case please
ensure the cups user and group has read/write access to /dev/ugen*

If you are using a USB printer wtih FreeBSD 8.0 or later, you will
need to find the proper /dev/usb/* device pointed at by the /dev/ugen*
entry. Follow the instructions for devfs.rules as above, but append a 
rule similar to the following for a printer attached as /dev/ugen0.2:

add path 'usb/0.2.*' mode 0660 group cups
```
Note especially;

```
2) And following to /etc/rc.conf:

devfs_system_ruleset="system"

3) Restart devfs: /etc/rc.d/devfs restart
```
also

```
$PREFIX/share/examples/cups/ulpt-cupsd.conf to $PREFIX/etc/devd/
```
generally translates to

```
/user/local/share/examples/cups/ulpt-cupsd.conf to /user/local/etc/devd/
```

--Chris


----------

