PHP daemon killed mysteriously
Forum
  1. Forums
  2. CloudLinux and Control Panels
  3. CloudLinux and cPanel
  1. rahnev
  2. Wednesday, 31 May 2017
  3.  Subscribe via email
I have a php script, which runs as daemon (by root user) and only writes current time to log file. This scripts is killed misteriously after 10-15 mins with no message to any log file. OS: Centos 6.9 + Cloudlinux + CageFS + cPanel. If I run the same daemon on Centos 6.9 only it doesn't stop. Is there something related to Cloudlinux which can kill the background process?
Scripts can be found in attached file.
Attachments (1)
Rate this post:
  1. 31.05.2017 13:05:16
  2. # 1
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
We have a cronjob which do kill php scripts which belongs to 'init' as parent, seems your script is affected by it.

Try commenting out /etc/cron.d/kill_orphaned_php-cron :

*/5 * * * * root bash /usr/sbin/kill_php_script
  1. 31.05.2017 13:05:15
  2. # 2
rahnev Accepted Answer
Posts: 11
Joined: 06.07.2016
0
Votes
Undo
Is there a way to exclude a script from that cron? I have disabled it now and will try to see if it is the reason for killing my script. Will keep you in touch. Thanks.
  1. 31.05.2017 14:05:15
  2. # 3
Bogdan Accepted Answer
Posts: 709
Joined: 26.06.2013
0
Votes
Undo
I worry there is no way to skip just your script, e.g. the file will be overwritten with the next update.

Actually, the right way to disable cronjob is to edit /etc/sysconfig//cloudlinux and change to Y:


disable_kill_orphaned_cron = Y
  1. 01.06.2017 06:06:54
  2. # 4
rahnev Accepted Answer
Posts: 11
Joined: 06.07.2016
0
Votes
Undo
Thanks Bogdan. This solved my problem.
  • Page :
  • 1


There are no replies made for this post yet.
Be one of the first to reply to this post!
Guest
Submit Your Response
Upload files or images for this discussion by clicking on the upload button below. Supports gif,jpg,png,zip,rar,pdf
• Insert • Remove Upload Files (Maximum File Size: 2 MB)
Captcha
To protect the site from bots and unauthorized scripts, we require that you enter the captcha codes below before posting your question.