You are not logged in.

#1 2012-09-03 20:14:09

troncoso
Member
Registered: 2008-08-28
Posts: 47

[SOLVED] systemd problem: scanimage works only as root

Hello,

I can list the scanner with lsusb, and it works with no error messages when I run scanimage. But the image file I get is corrupted. However if I do it as root, then the file is OK.

I've just changed to systemd and I wonder if that might have something to do with it.

Any help with this problem would be greatly appreciated. Thank you.

Last edited by troncoso (2012-09-05 20:05:03)

Offline

#2 2012-09-03 23:19:28

nomorewindows
Member
Registered: 2010-04-03
Posts: 3,003

Re: [SOLVED] systemd problem: scanimage works only as root

You need to add user to the scanner group.


I may have to CONSOLE you about your usage of ridiculously easy graphical interfaces...
Look ma, no mouse.

Offline

#3 2012-09-04 04:49:50

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

nomorewindows wrote:

You need to add user to the scanner group.

I'm already in the scanner group. In fact, I've been using the scanner without a problem for years.

Offline

#4 2012-09-05 07:33:32

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

I've just seen that there's an error message when I run 'scanimage -L' as a normal user which doesn't show when I issue the command as root;

$ scanimage -L
Failed cupsGetDevices
device `plustek:libusb:004:002' is a Canon CanoScan N650U/N656U flatbed scanner
$ su
# scanimage -L
device `plustek:libusb:004:002' is a Canon CanoScan N650U/N656U flatbed scanner

So what does the error 'Failed cupsGetDevices' mean? Maybe I forgot to enable something when I moved to systemd?

Any help on this would be much appreciated. Thanks

Offline

#5 2012-09-05 08:06:38

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

I added myself to group lp in case it might have something to do with the 'Failed cupsGetDevices' error, but that didn't help. I keep getting the same error when I run 'scanimage -L':

$ groups
lp wheel network audio optical scanner pepe vboxusers
$ scanimage -L
Failed cupsGetDevices
device `plustek:libusb:004:002' is a Canon CanoScan N650U/N656U flatbed scanner

And I still get a corrupted image file:

$ scanimage -x 50 -y 50 | convert - image.png
convert: no decode delegate for this image format `/tmp/magick-WUIJ5cLz' @ error/constitute.c/ReadImage/544.
convert: no images defined `image.png' @ error/convert.c/ConvertImageCommand/3044.

However, I get no errors if I issue the commands as root. Could all this be related to my recent move to systemd?

Offline

#6 2012-09-05 08:37:44

knedlyk
Member
From: L'viv, Ukraine
Registered: 2009-04-14
Posts: 153
Website

Re: [SOLVED] systemd problem: scanimage works only as root

I experienced the same behavior with my scanner, all the time "Failed cupsGetDevices" as normal user and no messages as root.

Offline

#7 2012-09-05 15:03:51

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

knedlyk wrote:

I experienced the same behavior with my scanner, all the time "Failed cupsGetDevices" as normal user and no messages as root.

Thanks for your comment. If that message has nothing to do with the subsequent failure to write the image file correctly, then what might be the cause of that failure? Does anyone know about any other executables that are called by that command and whose permissions I might check?

Offline

#8 2012-09-05 18:50:43

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

Now I do believe this issue is related to the move to systemd. There are two reasons:
1. I hadn't experienced this problem before I moved to systemd.
2. I have just checked on a system where I still have initscripts and the problem doesn't appear.

I also think that the 'Failed cupsGetDevices' error may have something to do with it, as this message doesn't appear with initscripts.

Offline

#9 2012-09-05 20:04:23

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

Yes, definitely the 'Failed cupsGetDevices' had something to do with this problem. I guess it is a bit of an overkill, but I added my private group to those listed in the 'SystemGroup' directive in cupsd.conf, and that fixed it. Now these commands run OK:

$ scanimage -L
device `plustek:libusb:004:005' is a Canon CanoScan N650U/N656U flatbed scanner
$ scanimage -x 50 -y 50 | convert - image.png

Just one more thing: if anyone knows how to allow a normal user to call cupsGetDevices without adding their private group as a cups system administration group, please let us know. And if someone had an explanation as to whether or how this issue is related to the move to systemd, that would be perfect.

Thank you all.

Offline

#10 2012-09-30 21:38:24

xsouku04
Member
Registered: 2012-09-28
Posts: 2

Re: [SOLVED] systemd problem: scanimage works only as root

troncoso wrote:

I added my private group to those listed in the 'SystemGroup' directive in cupsd.conf, and that fixed it.

Thank you for your comment.  My line nuber 13 of cupsd.conf looks now like this and sort of fixed the issue.

 SystemGroup sys root users

Scanimage -L works without complain, but it takes much longer time then before. There is huge delay fore the scanning starts.
If I stop cups by issuing /etc/rc.d/cupsd stop  The problem starts again, however there is no delay.

The corrupted scan image file has got the "Failed cupsGetDevices" at the very beginning of it added.  That is why it is corrupted.


If I do scanning using xsane, there is no delay nor corrupted file. It just works fine without cupsd running.

Is there any way I can fix this issue and don't let cups to delay the scanning nor add the "Failed cupsGetDevices" at the beginning of the file ?

Is there a way to say scanimage not to use cups  at all?

Last edited by xsouku04 (2012-09-30 21:40:37)

Offline

#11 2012-10-01 15:33:23

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

Actually my line from cupsd.conf looks like this:

SystemGroup sys root scanner

I can tell you that I haven't noticed any delay but I've no answer to your question about preventing scanimage from using cups.

Offline

#12 2012-10-02 07:56:24

xsouku04
Member
Registered: 2012-09-28
Posts: 2

Re: [SOLVED] systemd problem: scanimage works only as root

Thanks. To get rid of the 8 second delay - avahi has to be running.  https://wiki.archlinux.org/index.php/avahi
In cups log there was dns-sd complain.
There was a problem with group permissions so avahi did not start. I did not know anything like avahi exists.

Offline

#13 2012-10-02 08:37:16

troncoso
Member
Registered: 2008-08-28
Posts: 47

Re: [SOLVED] systemd problem: scanimage works only as root

xsouku04 wrote:

To get rid of the 8 second delay - avahi has to be running.

So that‘s why I didn’t notice the delay, because avahi was running.

Offline

#14 2012-12-05 10:45:15

neithere
Member
Registered: 2012-12-05
Posts: 1
Website

Re: [SOLVED] systemd problem: scanimage works only as root

Nothing of the above helped me. So after some additional googling I discovered that the root of the problem was a bug in sane-backends:  http://arch.debian.org/tracker/?func=de … p_id=30186

Installing sane-git from AUR has fixed the problem.

Last edited by neithere (2012-12-05 10:51:12)

Offline

Board footer

Powered by FluxBB