Re: [clug] killing a looping / hung script?

Bob Edwards <bob-mVUT9YNL7HhWG/[email protected]> Tue, 6 Dec 2016 17:23:33 +1100
Newsgroups gmane.org.user-groups.clug
Message-ID <[email protected]>
On 06/12/16 17:05, Paul Wilson wrote:
> I have a perl script which occasionally goes into a hung or wait state, and
> wanted to know is there a standard way to automatically kill this process
> after some timeout (eg 1 min).
> Note the perl script is doing a Serial port read and for some reason it
> waits if there is an issue with the Arduino.
>
> ie can I use some sort of wrapper script to check this state and kill it?
>
> Paul
>

Don't know about Perl, but in C/glibc you would use select(2) (or,
if you are all "oh, I might miss a signal" etc., then you might use
poll(2)...). Not really a wrapper as much as an attempt to fix the
underlying problem.

I'd be surprised if Perl didn't have something equivalent.

cheers,

Bob Edwards.

-- 
linux mailing list
[email protected]
https://lists.samba.org/mailman/listinfo/linux