Page 1 of 1

calling shell scripts creates zombie processes

Posted: Fri Jan 03, 2025 6:45 pm
by uriebe
Raspberry PI 4 running Bullseye
and
QLC+ 4.12.3 (installed via APT)

the system and QLC runs 24/7 like a charm - except:

in the virtual console i implemented some buttons - each of them triggering a shell (BASH) script like:
systemcommand:/home/pi/camera_on.sh

with the script

Code: Select all

#!/bin/bash
libcamera-hello --width 800 --height 600 -t 0 --ev 1 --brightness 0.1 --contrast 1 --framerate 12
exit 0
each script call resulting in a zombie process

Code: Select all

pi@pimobile01:~$ ps aux | grep defunct
pi        3500  0.0  0.0      0     0 ?        Z    Jan01   0:00 [camera_on.sh] <defunct>
pi        3595  0.0  0.0      0     0 ?        Z    Jan01   0:00 [camera_off.sh] <defunct>
pi        4178  0.0  0.0      0     0 ?        Z    Jan01   0:00 [camera_on.sh] <defunct>
pi        4205  0.0  0.0      0     0 ?        Z    Jan01   0:00 [video_play.sh] <defunct>
pi        4217  0.0  0.0      0     0 ?        Z    Jan01   0:00 [video_stop.sh] <defunct>
pi        4223  0.0  0.0      0     0 ?        Z    Jan01   0:00 [bmr_116_on.sh] <defunct>
pi        4228  0.0  0.0      0     0 ?        Z    Jan01   0:00 [bmr_116_off.sh] <defunct>
pi        4233  0.0  0.0      0     0 ?        Z    Jan01   0:00 [bmr_116_blackou] <defunct>
pi        4235  0.0  0.0      0     0 ?        Z    Jan01   0:00 [bmr_116_blackof] <defunct>
pi        5862  0.0  0.0      0     0 ?        Z    Jan01   0:00 [camera_off.sh] <defunct>
those processes get deleted when i close QLC+.
but i want to keep it running.
double forking did not help.

i guess it's QLC that should check (via "wait"?) its' subprocesses...

did anyone encounter this behaviour or has any clue how to prevent zombie processes?

thanks and greetings.

Re: calling shell scripts creates zombie processes

Posted: Sat Jan 04, 2025 2:02 pm
by mcallegari
Use the latest QLC+ version.

Re: calling shell scripts creates zombie processes

Posted: Tue Jan 14, 2025 4:36 pm
by uriebe
grazie, massimo,

i got the latest stable version for Bullseye now and everything is fine.

no more zombies with 4.12.7