Skip to content

Commit

Permalink
Update scanRear.sh
Browse files Browse the repository at this point in the history
changed process killing to also kill subprocesses of waiting OCR trigger
  • Loading branch information
PhilippMundhenk authored Sep 16, 2024
1 parent 28b6136 commit 92b9b26
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion script/scanRear.sh
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ output_file="${filename_base}%04d.pnm"

cd "/tmp/${date}" || exit

kill -9 "$(cat scan_pid)"
pkill -P "$(cat scan_pid)"
rm scan_pid

#sthg is wrong with device name, probably escaping, use default printer:
Expand Down

3 comments on commit 92b9b26

@pedropombeiro
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@PhilippMundhenk This change seems to have broken duplex scans for me, not sure why:

/opt/brother/scanner/brscan-skey/script/scantofile.sh: line 7: UID: readonly variable
filename: /tmp/2024-09-22-18-40-33/2024-09-22-18-40-33-front-page%04d.pnm
scanimage: rounded value of br-x from 215 to 211.881
scanimage: rounded value of br-y from 297 to 296.973
Scanning infinity pages, incrementing by 1, numbering from 1
Scanning page 1
Scanned page 1. (scanner status = 5)
Scanning page 2
Scanned page 2. (scanner status = 5)
Scanning page 3
scanimage: sane_start: Document feeder out of documents
Batch terminated, 2 pages scanned
conversion process for 2024-09-22-18-40-33 is running in PID: 157
scantoemail.sh triggered
/opt/brother/scanner/brscan-skey/script/scantoemail.sh: line 8: UID: readonly variable
Terminated
converting to PDF for 2024-09-22-18-40-33...
SSH environment variables not set, skipping inotify trigger.
TELEGRAM_TOKEN or TELEGRAM_CHATID is not set
cleaning up for 2024-09-22-18-40-33...
OCR environment variables not set, skipping OCR.
scanimage: rounded value of br-x from 215 to 211.881
scanimage: rounded value of br-y from 297 to 296.973
Scanning infinity pages, incrementing by 1, numbering from 1
Scanning page 1
cannot open /tmp/2024-09-22-18-40-33/2024-09-22-18-40-33-back-page0001.pnm.part
scanimage: rounded value of br-x from 215 to 211.881
scanimage: rounded value of br-y from 297 to 296.973
Scanning infinity pages, incrementing by 1, numbering from 1
Scanning page 1
cannot open /tmp/2024-09-22-18-40-33/2024-09-22-18-40-33-back-page0001.pnm.part
number of pages scanned: 0
mv: cannot stat '*front*.pnm': No such file or directory
mv: cannot stat '*back*.pnm': No such file or directory
converting to PDF for 2024-09-22-18-40-33...
gm convert: Unable to get current working directory [No such file or directory].
SSH environment variables not set, skipping inotify trigger.
shell-init: error retrieving current directory: getcwd: cannot access parent directories: No such file or directory
TELEGRAM_TOKEN or TELEGRAM_CHATID is not set

@PhilippMundhenk
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:O You are right, something is wrong here. Conversion process starts too early (likely the one . For some reason, I am still getting correct two page scans, though. But definitely something wrong here. Since I mostly made this cahnge to make the web interface look nicer/more accurate, let me revert this first and find a better solution here. Correct functionality trumps design, this is not Apple... ;)

@PhilippMundhenk
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

see #36

Please sign in to comment.