Thread Rating:
  • 1 Vote(s) - 5 Average
  • 1
  • 2
  • 3
  • 4
  • 5
User Cron jobs not working in cpanel
#1
Lightbulb 
Hi

I have a cpanel server and the cpanel cron jobs are not at all running. I can see them when I use command " crontab -l -u chris "  but in the cron log , I am not seeing any thing for this running. 

Do any of you have any idea in this case ? The only recent change made to the server which was near to 2 week before is server hardening. 

Dodgy
Reply
#2
Hi

Recently  similar situation came in front of from a customer and the fix which worked for me was the below

1 st Fix
=======

Check and confirm if you have enabled RESTRICT_SYSLOG and if enabled try disabling the same by changing the values  to 1 0r 2  

Reference Link : https://forums.cpanel.net/threads/user-c...ng.567221/

2nd Fix
=======

This fix has helped me a more than twice now . It seems some servers is having issues with LES and you might need to change the permissions of atleast 3 binaries in my expereince

From the installation log, I can see LES is changing permission of the binaries listed below to 700

===================
server les(5972): {sec.bin} chmod 700 /bin/dmesg
server les(5972): {sec.bin} chmod 700 /bin/mount
server les(5972): {sec.bin} chmod 700 /bin/rpm
server les(5972): {sec.bin} chmod 700 /usr/bin/write
server les(5972): {sec.bin} chmod 700 /bin/logger
server les(5972): {sec.bin} chmod 700 /usr/bin/ipcrm
server les(5972): {sec.bin} chmod 700 /usr/bin/ipcs
server les(5972): {sec.bin} chmod 700 /usr/bin/free
server les(5972): {sec.bin} chmod 700 /usr/bin/locate
server les(5972): {sec.bin} chmod 700 /usr/bin/wall
server les(5972): {sec.bin} chmod 700 /sbin/arp
server les(5972): {sec.bin} chmod 700 /sbin/ifconfig
server les(5972): {sec.bin} chmod 700 /usr/sbin/repquota
server les(5972): {sec.bin} chmod 700 /usr/sbin/tcpdump
server les(5972): {sec.bin} chmod 700 /usr/bin/wget
server les(5972): {sec.bin} chmod 700 /usr/bin/lynx
server les(5972): {sec.bin} chmod 700 /usr/bin/cc
server les(5972): {sec.bin} chmod 700 /usr/bin/gcc
server les(5972): {sec.bin} chmod 700 /usr/bin/logger
server les(5972): {sec.bin} chmod 700 /usr/bin/who
server les(5972): {sec.bin} chmod 700 /usr/bin/w
server les(5972): {glob} sec.bin enabled
==================

Amoung those I only changed the below three which the cron jobs might be mostly depended.

/bin/rpm
/usr/bin/wget
/usr/bin/lynx

Changing the above binaries to 755 permission fixed my issues and cron jobs for users started showing up in logs as well.

https://www.rfxn.com/projects/linux-envi...-security/
Reference Link : http://stackoverflow.com/questions/33420...8#33704328

#3 rd fix possibility

If you have cloudlinux / CageFS installted, then you might need to reinstate the Cagefs and see if that fixes or disabling the cagefs fully as well.

If any pf these 3 is not helping, then it needs more deep investigation.

Please check the above details.
Reply
#3
You are a saviour !!!.. Yes My issue fixed after fixing the permission and yes there was LES installed during Hardening.

Once again Thanks a lot for this man !!! I owe you a beer ...
Reply
#4
Glad to hear that Techllinux reply helped you Chris. Me also noted down the fix for future reference

Thank you Techyllinux
Reply
#5
Hi

Adiditonaly to CSF RESTRICT_SYSLOG, once changed the option, you may have to change the permissio to 666 for /dev/log.

Reply from one of the cpanel techs
===========================
Non-default Perms: /dev/log [mode 0660] (default 0666) - CSF RESTRICT_SYSLOG can change this. Non-root users may not be able to log to syslog, including user cron jobs to /var/log/cron.

This may possibly be the cause of the crons to fail to properly load. I changed the permissions for the /dev/log file to 666 now so lets check to see if crons now run

[01:40:13 server101 root@7878233 /dev]cPs# stat log
File: `log'
Size: 0 Blocks: 0 IO Block: 4096 socket
Device: 5h/5d Inode: 9592 Links: 1
Access: (0660/srw-rw----) Uid: ( 0/ root) Gid: ( 494/mysyslog)
Access: 2016-11-03 01:59:01.741000037 -0400
Modify: 2016-11-02 01:58:43.860755866 -0400
Change: 2016-11-02 01:58:46.211755864 -0400
[01:40:15 server101 root@7878233 /dev]cPs# chmod 666 log
[01:40:23 server101 root@7878233 /dev]cPs#
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)