WiFi
Posts: 34
Joined: Sat Oct 19, 2013 6:01 pm

Incron Bug: Generating Zombie Processes

Mon May 25, 2020 4:37 am

Hi,

I am a bit lost how to proceed - need expert advice:

I am struggling with the incron bug (well known to the community - try a search "incron bug zombie debian buster" by Google search. Whenever incron activates bash scripts (exampl. mailer_x.sh) after I have dropped a file(s) in sensitive directories, many Zombie processes are generated like this:


Code: Select all


$ ps -ef --forest
...

root       609     1  0 Mai24 ?        00:00:00 /usr/sbin/incrond
root      5764   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
pi        5765   609  0 05:29 ?        00:00:00  \_ [mailer_x.] <defunct>
root      5766   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5769   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5770   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5784   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5785   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5787   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5789   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5790   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5791   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5794   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5795   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5797   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5799   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5800   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5801   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5804   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5805   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5806   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5809   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5810   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>
root      5811   609  0 05:29 ?        00:00:00  \_ [bash] <defunct>

...
After some events (when process table quotas of 32.xxx are exceeded) new process generation is blocked and I am forced to restart incron (identified as the parent process of the zombies) ... and the Zombies are gone.

Version status is:

Code: Select all


PRETTY_NAME="Raspbian GNU/Linux 10 (buster)"
NAME="Raspbian GNU/Linux"
VERSION_ID="10"
VERSION="10 (buster)"
VERSION_CODENAME=buster
ID=raspbian
ID_LIKE=debian
HOME_URL="http://www.raspbian.org/"
SUPPORT_URL="http://www.raspbian.org/RaspbianForums"
BUG_REPORT_URL="http://www.raspbian.org/RaspbianBugs"



Linux version 4.19.97+ (dom@buildbot) (gcc version 4.9.3 (crosstool-NG crosstool-ng-1.22.0-88-g8460611)) #1294 Thu Jan 30 13:10:54 GMT 2020


What is the expert's recommendation?

1. How to bypass this bug professionally until being solved finally by the linux developers? Restart of incron periodically (on event? which event? on schedule? ...)
2. How to find out, what the Debian Linux / package developers activities are momentarily to heal the bug? Prognosis being solved ?
3. In case Debian has already solved the problem - when will it be solved in the Raspbian package (i have just updated / upgraded - still present)?
4. Any other hint (avoiding incron is not a real option ....)?

Any help is very much appreciated - thanks in advance

Regards wifi

ejolson
Posts: 5373
Joined: Tue Mar 18, 2014 11:47 am

Re: Incron Bug: Generating Zombie Processes

Mon May 25, 2020 5:00 am

I tried your suggested search. The link

https://stackoverflow.com/questions/537 ... -code-is-1

indicates returning from all your scripts and programs with an error code as

exit 1

prevents zombies from accumulating.

Without looking, it's easy to imagine the code quality of incrond might be lacking. Have you taken a look or tried to build your own version from current sources?

WiFi
Posts: 34
Joined: Sat Oct 19, 2013 6:01 pm

Re: Incron Bug: Generating Zombie Processes

Mon May 25, 2020 5:12 am

Hello ejolson,

thanks fot your response, I know this link, unfortunately this linked advice doesn't help / doesn't change the zombie gereration (for debian / raspian).

:|

Regards, wifi

WiFi
Posts: 34
Joined: Sat Oct 19, 2013 6:01 pm

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 11:50 am

Question in principle:

I have succeeded to shoot the Zombies by "service incron restart".

Now I want to automize this periodically bay a Cron entry.

A bit troubled I had noticed, that no restart has been issued by Cron!

Is this a principle problem that Cron cannot restart system services ... or am I msitaken for other reasons?

Bet regards

wifi

User avatar
dickon
Posts: 1539
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 5:29 pm

Why not just use a different cron?

WiFi
Posts: 34
Joined: Sat Oct 19, 2013 6:01 pm

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 6:46 pm

Hi dickon, many thanks for answering!

Different cron :?:

What do you mean by this?

I am using the cron of user root ... to be on the save side and avoid any access conflicts in the testing phase.

Regards

wifi

ejolson
Posts: 5373
Joined: Tue Mar 18, 2014 11:47 am

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 6:48 pm

dickon wrote:
Tue May 26, 2020 5:29 pm
Why not just use a different cron?
That was discussed in the first post.
WiFi wrote:
Mon May 25, 2020 4:37 am
4. Any other hint (avoiding incron is not a real option ....)?
Did you try putting something like

Code: Select all

(
    while sleep 43200
    do
        service incron restart
    done
) &
in /etc/rc.local or similar?

User avatar
dickon
Posts: 1539
Joined: Sun Dec 09, 2012 3:54 pm
Location: Home, just outside Reading

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 6:55 pm

Was it? I don't see any reference.

WiFi
Posts: 34
Joined: Sat Oct 19, 2013 6:01 pm

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 6:58 pm

ejolson wrote:
Tue May 26, 2020 6:48 pm
dickon wrote:
Tue May 26, 2020 5:29 pm
Why not just use a different cron?
That was discussed in the first post.
WiFi wrote:
Mon May 25, 2020 4:37 am
4. Any other hint (avoiding incron is not a real option ....)?
Did you try putting something like

Code: Select all

(
    while sleep 43200
    do
        service incron restart
    done
) &
in /etc/rc.local or similar?
Okay- : :idea: got you ! I will give it a try. :)

But sometimes I am annoying - beg your pardon - any idea why the regular cron service does not restart incron?

Best regards

wifi

ejolson
Posts: 5373
Joined: Tue Mar 18, 2014 11:47 am

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 7:15 pm

WiFi wrote:
Tue May 26, 2020 6:58 pm
ejolson wrote:
Tue May 26, 2020 6:48 pm
dickon wrote:
Tue May 26, 2020 5:29 pm
Why not just use a different cron?
That was discussed in the first post.
WiFi wrote:
Mon May 25, 2020 4:37 am
4. Any other hint (avoiding incron is not a real option ....)?
Did you try putting something like

Code: Select all

(
    while sleep 43200
    do
        service incron restart
    done
) &
in /etc/rc.local or similar?
Okay- : :idea: got you ! I will give it a try. :)

But sometimes I am annoying - beg your pardon - any idea why the regular cron service does not restart incron?

Best regards

wifi
Probably something to do with a typo or missing path. Some simple things can be difficult to debug. Are there any log files for cron or did systemd assimilate them?

WiFi
Posts: 34
Joined: Sat Oct 19, 2013 6:01 pm

Re: Incron Bug: Generating Zombie Processes

Tue May 26, 2020 8:24 pm

Probably something to do with a typo or missing path. Some simple things can be difficult to debug. Are there any log files for cron or did systemd assimilate them?


:mrgreen: ... you made my night - I had forgotten to add the path ... /usr/sbin/service :oops:

In addition I found this solution

Code: Select all

 ps -aux  | wc -l  
to test periodically the ## of Zombies ... now being able to issue an incron restart when getting critical near to 30.000+ processes in total!

Thanks very much - problem solved (as a work around).

Remains the scientific question ... is incron so "non-reliable" in the Linux world ? Why ? Is this true for more Linux functionalities?
I had expected more sharpness on bugs and bugfix status.

Definitely the recommended workaround "exit > 0" doesn't fix the bug (reliable) - seen by evidence.

Regards

wifi

Return to “Advanced users”