Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

units: cannot open file '/root/.units': Permission denied #45

Closed
kleinarne opened this issue Oct 8, 2022 · 2 comments
Closed

units: cannot open file '/root/.units': Permission denied #45

kleinarne opened this issue Oct 8, 2022 · 2 comments

Comments

@kleinarne
Copy link

kleinarne commented Oct 8, 2022

I'm trying to get scanbd to call sane-scan-pdf when pressing the scan button on my Fujitsu S1300i.

When I run scanbd with sudo SANE_CONFIG_DIR=/etc/scanbd scanbd -d7 -f and press the scan button, I get the following debug output. Note the two lines units: cannot open file '/root/.units': Permission denied.

I don't know how to fix this...

scanbd: value trigger: numerical
scanbd: trigger action for scan for device epjitsu:libusb:001:004 with script epjitsu.script
scanbd: get_sane_option_value
scanbd: Value of mode as string (len 7, hash -621353420): Lineart
scanbd: setting env: SCANBD_FUNCTION_MODE=Lineart
scanbd: setting env: PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
scanbd: No PWD, setting env: PWD=/home/username
scanbd: setting env: USER=root
scanbd: setting env: HOME=/root
scanbd: setting env: SCANBD_DEVICE=epjitsu:libusb:001:004
scanbd: setting env: SCANBD_ACTION=scan
scanbd: append string epjitsu:libusb:001:004 to signal scan_begin
scanbd: now sending signal scan_begin
scanbd: Iteration on dbus call
scanbd: append string SCANBD_FUNCTION_MODE=Lineart to signal trigger
scanbd: append string PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin to signal trigger
scanbd: append string PWD=/home/username to signal trigger
scanbd: append string USER=root to signal trigger
scanbd: append string HOME=/root to signal trigger
scanbd: append string SCANBD_DEVICE=epjitsu:libusb:001:004 to signal trigger
scanbd: append string SCANBD_ACTION=scan to signal trigger
scanbd: now sending signal trigger
scanbd: now flushing the dbus
scanbd: unref the signal
scanbd: using relative script path: epjitsu.script, expanded to: /usr/share/scanbd/scripts/epjitsu.script
scanbd: waiting for child: /usr/share/scanbd/scripts/epjitsu.script
scanbd: setgid to gid=114
scanbd: setuid to uid=110
scanbd: exec for /usr/share/scanbd/scripts/epjitsu.script
scanbd: octal mode for /usr/share/scanbd/scripts/epjitsu.script: 100755
scanbd: file uid: 0, file gid: 0
units: cannot open file '/root/.units': Permission denied
units: cannot open file '/root/.units': Permission denied
Scanning...
scanadf: open of device fujitsu failed: Invalid argument
Found no scans.
scanbd: child /usr/share/scanbd/scripts/epjitsu.script exited with status: 0
scanbd: Iteration on dbus call
scanbd: append string epjitsu:libusb:001:004 to signal scan_end
scanbd: now sending signal scan_end
scanbd: reopen device epjitsu:libusb:001:004
@kleinarne
Copy link
Author

kleinarne commented Oct 8, 2022

Well, after posting this I found #16, which eventually solved it - I had to update the script that calls scan,

from

#!/bin/sh
now=`date +"%Y-%m-%d-%H%M"`
/home/username/sane-scan-pdf/scan -d -r 300 -v -m Lineart --skip-empty-pages -o /home/username/scans/scan-$now.pdf

to

#!/bin/sh
now=`date +"%Y-%m-%d-%H%M"`
/home/username/sane-scan-pdf/scan --device "" --no-default-size -d -r 300 -v -m Lineart --skip-empty-pages -o /home/username/scans/scan-$now.pdf

--device "" fixed the scanadf: open of device fujitsu failed: Invalid argument error,
--no-default-size fixed the units: cannot open file '/root/.units': Permission denied error.

And then it scanned, albeit 15 seconds or so after pressing the button.

/edit: Your comment in #39 (comment) about calling scanadf without the -d parameter fixed it for me too, I changed the --device "" parameter to --device "epjitsu" which also fixed the delay.

Anyway, I'll close this.

@rocketraman
Copy link
Owner

Glad you got it all working and thanks for updating the issue with your solution and issue references! Cheers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants