[sane-devel] Best way to stop scanimage?

Olaf Meeuwissen paddy-hack at member.fsf.org
Fri Sep 29 14:31:46 UTC 2017


Hi Jeff,

Jeff Sadowski writes:

> Thank you Olaf, :-)
>
> I am developing a php interface I'm calling it php saneng I have it on
> bitbucket for now and using proc_open. I will send the signal via
> proc_terminate giving it the second option being the signal I want to use.
> I had a similar project I got working in the past specifically for my
> scanner and I seem to recall I was giving it signal SIGTERM and I think
> that was causing issues where as when I would test from the command line
> and use ctrl+c it would leave the scanner in a usable state. So now that I
> read about what ctrl+c sends (SIGINT) I think it would be better to send
> that. Maybe there is something wrong with brothers backend that it prefers
> a SIGINT over a SIGTERM. I'll experiment and let you know once I get my
> project a little farther along. My similar project I had got working was
> destroyed when an upgrade failed and I forgot to back it up. No biggy I
> should have a better working one in a few weeks.

The sighandler in scanimage simply calls sane_cancel() the first time
around and _exit(0) the second.  The signal would normally be handled
by the scanimage frontend.  Some backends register their own handlers
which may change the picture I painted in my earlier mail.

# Sorry, didn't think things thru.  It's Friday night ...

Since Brother's backend is a non-free black box, you're in the dark as
to what it does and just have to give things a try :-(

Hope this helps,
--
Olaf Meeuwissen, LPIC-2            FSF Associate Member since 2004-01-27
 GnuPG key: F84A2DD9/B3C0 2F47 EA19 64F4 9F13  F43E B8A4 A88A F84A 2DD9
 Support Free Software                        https://my.fsf.org/donate
 Join the Free Software Foundation              https://my.fsf.org/join



More information about the sane-devel mailing list