Author Topic: Cron Not Working, Error "No such file or directory"  (Read 577 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
Cron Not Working, Error "No such file or directory"
« on: May 22, 2022, 06:34:58 PM »
I have a problem with CRON, the panel shows that Cron is active, but I see that our application does not work, it only works manually. I saw an error in the email

Code: [Select]
"execl: could not execute `/usr/local/cpanel/bin/jailshell'
execl: No such file or directory"



Could this be why Cron doesn't work?

How to solve this Problem, Any Command?

Offline
****
Re: Cron Not Working, Error "No such file or directory"
« Reply #1 on: May 23, 2022, 02:24:01 AM »
Seems like that cron is a remnant from an old cpanel server.  Can you post the output of crontab -l
Google Hangouts:  rcschaff82@gmail.com

Offline
*****
Re: Cron Not Working, Error "No such file or directory"
« Reply #2 on: May 23, 2022, 09:09:07 AM »
Use the command below and remove the line SHELL=/usr/local/cpanel/bin/jailshell
Code: [Select]
crontab -eu USERNAMEWhere USERNAME the username which have the issue.
You can ask me to solve any problem with your server for some money in pm  ;)
Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor
Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp

Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Re: Cron Not Working, Error "No such file or directory"
« Reply #3 on: May 23, 2022, 01:01:18 PM »
Seems like that cron is a remnant from an old cpanel server.  Can you post the output of crontab -l

Hello,

Code: [Select]
[root@server ~]# crontab -l
42 0 * * * /root/.acme.sh/acme.sh --cron --home /root/.acme.sh/cwp_certs > /dev/                                        null
00 00 * * * /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admi                                        n/include/cron_autossl_all_domains.php
00 00 * * * /usr/local/cwp/php71/bin/php /usr/local/cwpsrv/htdocs/resources/admi                                        n/include/alertandautorenewssl.php
15 0 * * * /usr/local/cwp/php71/bin/php-cgi -d max_execution_time=100000000 -q /                                        usr/local/cwpsrv/htdocs/resources/admin/include/cron_newbackup.php
[root@server ~]#

Above the Path, What would be the next step?
Even These Cwp Crons Are Not Working!

Abaixo

Code: [Select]
[root@server ~]# sudo tail /var /log /syslog
==> /var <==
tail: error reading ‘/var’: Is a directory
tail: cannot open ‘/log’ for reading: No such file or directory
tail: cannot open ‘/syslog’ for reading: No such file or directory
[root@server ~]# systemctl status cron
Unit cron.service could not be found.
You have new mail in /var/spool/mail/root
[root@server ~]# sudo service cron start
Redirecting to /bin/systemctl start cron.service

** (pkttyagent:4370): WARNING **: 09:57:59.006: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)
Failed to start cron.service: Unit not found.
[root@server ~]#

Offline
*
Re: Cron Not Working, Error "No such file or directory"
« Reply #4 on: May 23, 2022, 01:29:49 PM »
Use the command below and remove the line SHELL=/usr/local/cpanel/bin/jailshell
Code: [Select]
crontab -eu USERNAMEWhere USERNAME the username which have the issue.

Hello Friend, This Occurs In All Server Users, How To Change All At Once? This error must be due to Migration from Cpanel to CWP :/

Offline
****
Re: Cron Not Working, Error "No such file or directory"
« Reply #5 on: May 23, 2022, 11:48:48 PM »
check /etc/passwd to see if the shell is set their.  If it's set in the crontab itself, you could create a script to remove the line automatically.  Please let me know which way the shell is set.
Google Hangouts:  rcschaff82@gmail.com

Offline
*
Re: Cron Not Working, Error "No such file or directory"
« Reply #6 on: May 24, 2022, 12:06:25 PM »
check /etc/passwd to see if the shell is set their.  If it's set in the crontab itself, you could create a script to remove the line automatically.  Please let me know which way the shell is set.

Hello Friend
Below are the Folder Lines etc/passwd
Code: [Select]
root:x:0:0:root:/root:/bin/bash
bin:x:1:1:bin:/bin:/sbin/nologin
daemon:x:2:2:daemon:/sbin:/sbin/nologin
adm:x:3:4:adm:/var/adm:/sbin/nologin
lp:x:4:7:lp:/var/spool/lpd:/sbin/nologin
sync:x:5:0:sync:/sbin:/bin/sync
shutdown:x:6:0:shutdown:/sbin:/sbin/shutdown
halt:x:7:0:halt:/sbin:/sbin/halt
mail:x:8:12:mail:/var/spool/mail:/sbin/nologin
operator:x:11:0:operator:/root:/sbin/nologin
games:x:12:100:games:/usr/games:/sbin/nologin
ftp:x:14:50:FTP User:/var/ftp:/sbin/nologin
nobody:x:99:99:Nobody:/:/sbin/nologin
systemd-network:x:192:192:systemd Network Management:/:/sbin/nologin
dbus:x:81:81:System message bus:/:/sbin/nologin
polkitd:x:999:998:User for polkitd:/:/sbin/nologin
sshd:x:74:74:Privilege-separated SSH:/var/empty/sshd:/sbin/nologin
postfix:x:89:89::/var/spool/postfix:/sbin/nologin
chrony:x:998:996::/var/lib/chrony:/sbin/nologin
named:x:25:25:Named:/var/named:/sbin/nologin
unbound:x:997:994:Unbound DNS resolver:/etc/unbound:/sbin/nologin
ntp:x:38:38::/etc/ntp:/sbin/nologin
noderig:x:1000:1000::/home/noderig:/bin/bash
beamium:x:1001:1001::/home/beamium:/bin/bash
mysql:x:996:993:MySQL server:/var/lib/mysql:/sbin/nologin
saslauth:x:995:76:Saslauthd user:/run/saslauthd:/sbin/nologin
dovecot:x:97:97:Dovecot IMAP server:/usr/libexec/dovecot:/sbin/nologin
dovenull:x:994:992:Dovecot's unauthorized user:/usr/libexec/dovecot:/sbin/nologin
tss:x:59:59:Account used by the trousers package to sandbox the tcsd daemon:/dev/null:/sbin/nologin
cwpsrv:x:993:991::/usr/local/cwpsrv:/sbin/nologin
Hi Friend, Look at the lines in the /etc/passwd folder

cwpsvc:x:992:990::/usr/local/cwpsrv/var/services:/sbin/nologin
login:x:991:989::/home/login:/sbin/nologin
clamupdate:x:990:988:Clamav database update user:/var/lib/clamav:/sbin/nologin
amavis:x:989:986:User for amavisd-new:/var/spool/amavisd:/sbin/nologin
clamscan:x:988:985:Clamav scanner user:/:/sbin/nologin
vmail:x:101:12:Virtual mailbox:/var/vmail:/sbin/nologin
vacation:x:987:984:Virtual vacation:/var/spool/vacation:/sbin/nologin
opendkim:x:986:983:OpenDKIM Milter:/var/run/opendkim:/sbin/nologin
rpc:x:32:32:Rpcbind Daemon:/var/lib/rpcbind:/sbin/nologin
memcached:x:985:982:Memcached daemon:/run/memcached:/sbin/nologin
redis:x:984:981:Redis Database Server:/var/lib/redis:/sbin/nologin
ldap:x:55:55:OpenLDAP server:/var/lib/ldap:/sbin/nologin
firebird:x:983:980::/:/bin/nologin
nginx:x:982:979:nginx user:/var/cache/nginx:/sbin/nologin
varnishlog:x:981:978:varnishlog user:/dev/null:/sbin/nologin
varnish:x:980:978:Varnish Cache:/var/lib/varnish:/sbin/nologin

User1:x:1041:1041::/home/User1:/sbin/nologin
User2:x:1042:1042::/home/User2:/sbin/nologin
User3:x:1043:1043::/home/User3:/sbin/nologin
User4:x:1044:1044::/home/User4:/sbin/nologin
User5:x:1045:1045::/home/User5:/sbin/nologin


Thank you for your help.

Offline
****
Re: Cron Not Working, Error "No such file or directory"
« Reply #7 on: May 25, 2022, 01:55:54 AM »
So at the head of every crontab (crontab -l), there should be a line "SHELL=..."   

please post crontab -lu {username}
Google Hangouts:  rcschaff82@gmail.com

Offline
*
Re: Cron Not Working, Error "No such file or directory"
« Reply #8 on: May 25, 2022, 01:04:00 PM »
So at the head of every crontab (crontab -l), there should be a line "SHELL=..."   

please post crontab -lu {username}

Hello Friend

Code: [Select]
[root@server ~]# crontab -lu user1
SHELL=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\                                                                                                 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"/usr/local/bin/jailshell\\                                                                                                 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\                                                                                                 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"
SHELL=\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\                                                                                                 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"/usr/local/bin/jailshell\\                                                                                                 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\                                                                                                 \\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\"

Look, it seems that the Cpanel folder is missing, the problem is when it runs in the PANEL oCron still doesn't work, now if I run the Cron in the CWP Root it works, that is, the Cron service is active, but it doesn't work for clients / users from the panel :(


Offline
****
Re: Cron Not Working, Error "No such file or directory"
« Reply #9 on: May 25, 2022, 09:13:14 PM »
Please run the following script on your server

Code: [Select]
cd /home && for D in *; do crontab -lu $D | sed '/SHELL=/d' | crontab -u $D -; done
Google Hangouts:  rcschaff82@gmail.com

Offline
*
Re: Cron Not Working, Error "No such file or directory"
« Reply #10 on: May 25, 2022, 09:19:44 PM »
Please run the following script on your server

Code: [Select]
cd /home && for D in *; do crontab -lu $D | sed '/SHELL=/d' | crontab -u $D -; done

Hello Friend

Result
Code: [Select]
[root@server ~]# cd /home && for D in *; do crontab -lu $D | sed '/SHELL=/d' | c                                                                                                 rontab -u $D -; done
no crontab for user1
no crontab for user12
crontab:  user `aquota.group' unknown
crontab:  user `aquota.group' unknown
crontab:  user `aquota.user' unknown
crontab:  user `aquota.user' unknown
no crontab for beamium
crontab:  user `bkp.tar.gz' unknown
crontab:  user `bkp.tar.gz' unknown
no crontab for user3
no crontab for user4
no crontab for user5
no crontab for user6
no crontab for user7
no crontab for user8
no crontab for user9
no crontab for user10
no crontab for user11
no crontab for noderig
no crontab for user12
no crontab for user13
no crontab for user14
crontab:  user `tmp_bak' unknown
crontab:  user `tmp_bak' unknown
You have new mail in /var/spool/mail/root

Offline
*
Re: Cron Not Working, Error "No such file or directory"
« Reply #11 on: May 25, 2022, 09:36:00 PM »
Please run the following script on your server

Code: [Select]
cd /home && for D in *; do crontab -lu $D | sed '/SHELL=/d' | crontab -u $D -; done

Friend, You're Amazing, It Worked, Now My Cron On The Panel, It's Working Again! This Command Saved My Server. I only have words of thanks. I wish you and your entire family, much success! Thank You For Patience.🙌🏼