libera/#maemo/ Thursday, 2019-04-04

DocScrutinizer05then OTOH I vaguely recall that without camera getting started at least once since boot, the videa had abysmal (or no) white balance done00:00
DocScrutinizer05also on N900 the gstreamer process doesn't get killed on teardown of connection - gotta come up with some smart(er) job management00:16
sicelothanks for the explanation.00:21
DocScrutinizer05yw :-) thanks for your interest00:36
sicelo;)00:37
DocScrutinizer05did I share that nice deep-insight "[bash] how to handle signals" stuff?00:54
DocScrutinizer05bottom line: when your script catches a signal that would normally make it abort, you MUST make the script terminate itself by sending that very signal to $self, to let outer shell wrappers know whether to continue or to abort00:56
DocScrutinizer05I.E do NOT use a simple `exit`00:57
DocScrutinizer05How the shell handles ^C (SIGINT) and why: http://www.cons.org/cracauer/sigint.html01:23
DocScrutinizer05TL;DR:       trap 'rm -f $TMP ; trap 2 ; kill -2 $$' 1 2 3 13 1501:24
luke-jrDocScrutinizer05: if only the boolean result matters, exit 1 works; if you need the exact correct result, then sending signal 2 won't be right for any of the other signals09:04
DocScrutinizer05no, the return code does NOT matter, see the article I linked17:25
DocScrutinizer05you may go fancy and set up a separate interrupt handler (trap) for every signal you catch, end send that very signal to $$ (self) after you did clanup17:27
DocScrutinizer05usually this is not necessary though17:27
* DocScrutinizer05 idly wonders if there is, or bash could learn to provide, a $SIGNAL env that contains an array of numeric IDs of signals the process received17:30
brolin_empeyDocScrutinizer05: Somewhat like ${PIPESTATUS} in bash?17:41
DocScrutinizer05sort of17:46
DocScrutinizer05of course you can do    trap 'cleanup INT' INT; trap 'cleanup ABRT' ABRT; ...17:47
DocScrutinizer05and have cleanup() deal with the signame parameter17:48
DocScrutinizer05or   for (i=1; i<=32; i++); do trap "cleanup $i" -$i; done;  #?17:52
DocScrutinizer05I'm not sure what the latter will do18:02
DocScrutinizer05not even allowed according to POSIX which only allows names for signal/condition, no integers18:03

Generated by irclog2html.py 2.17.0 by Marius Gedminas - find it at https://mg.pov.lt/irclog2html/!