Skip to content
Advertisement

Some programs not started by bash script when script ran as a crontab job but all programs can be started by manually run the bash script

Problem

I have some similar bash scripts to start about hundred processes, these bash scripts runs once very day at 09:12, they run well when the processes was not so many before, but as processes to start by scripts increased recent days, I found that some of processes not be started. I ran the script manually to check what happened, but all processes started well by the bash script be manually ran.

Some of those processes not been started leave core dump, it shows Program terminated with signal SIGABRT when call std::thread to create a thread.

The system is ubuntu server 18.04.4 LTS, crontab and manually ran as a normal user.

What I’ve tried

I seperated the script into two, starts diffrent part of processes each, one crontab at 09:12 the other one at 09:25. but no lucky, the first script can’t start part of processes, the second can start none of processes.

I have checked if something reached system limits, no limits reached.

Code

bash script “Signal_IF_trend.sh” as below

JavaScript

the users crontab

JavaScript

gdb displays for the core dump(updated after install glibc source)

JavaScript

user received mail

JavaScript

Advertisement

Answer

Finally, this problem solved. The key is TasksMax’s setting for cron.service limits the scripts to create more processes.

Resolution for Ubuntu Server 18.04

Edit the system.conf file in /etc/systemd

JavaScript

add the following line to the end of system.conf

JavaScript

reboot the server

How to check

command “systemctl status cron” can show below infomation

before modify system.conf

JavaScript

notice the line Tasks: 4743 (limit: 4915), Tasks is close to limit. after modify the system.conf file

JavaScript
User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement