cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

ScanGear only works for some users, on Ubuntu Linux

Smylers
Apprentice

Hi. Our Canon Pixma MX475 is working fine for me on Ubuntu Linux 20.04 LTS. However, ScanGear won't work for my child, when logging in to their own user account on the same laptop as me.

 

If they run scangearmp, the list of scanners appears. But for my child, pressing OK then gives the error message: “ScanGear: Internal Error occurred. Scanner driver will be closed.”

 

For me, pressing the same button let's me do some scanning. I'm not running as root. I've added my child's account to the scanner system group. The results are the same regardless of which one of us logs in first or runs scangearmp first.

 

What is it that's preventing ScanGear from working for one account when it runs fine from another?

 

Is there a log file or somewhere I can look to see a more detailed error message?

 

I have the scangearmp-mx470series Debian package installed, version 2.30-1. I think I downloaded  from here (but it was a while ago): https://my.canon/en/support/0100587102

 

Thanks.

1 ACCEPTED SOLUTION

Smylers
Apprentice

I found the problem: scangearmp creates the file /var/tmp/canon_sgmp_setting_common.ini if it doesn't already exist, then attempts to chmod it so that all users can write to it (even if that's already the case).

 

But that doesn't work, because only the user that created the file can chmod it. So when invoked by a different user, the chmod, and the entire scangearmp process, fails.

 

My fix is to remove the file every time after scangear runs. Specifically I have /usr/local/bin/scangearmp as this shell script, wrapping the real command:

 

     #! /bin/sh

    /usr/bin/scangearmp

    state_file=/var/tmp/canon_sgmp_setting_common.ini

    if [ -e "$state_file" ]
    then
      rm "$state_file"
    fi

View solution in original post

1 REPLY 1

Smylers
Apprentice

I found the problem: scangearmp creates the file /var/tmp/canon_sgmp_setting_common.ini if it doesn't already exist, then attempts to chmod it so that all users can write to it (even if that's already the case).

 

But that doesn't work, because only the user that created the file can chmod it. So when invoked by a different user, the chmod, and the entire scangearmp process, fails.

 

My fix is to remove the file every time after scangear runs. Specifically I have /usr/local/bin/scangearmp as this shell script, wrapping the real command:

 

     #! /bin/sh

    /usr/bin/scangearmp

    state_file=/var/tmp/canon_sgmp_setting_common.ini

    if [ -e "$state_file" ]
    then
      rm "$state_file"
    fi

Announcements