Cronjob notificatin sed: can't read /usr/share/Modules/init/.modulespath: No such file or directory / when using jailshell

mean

Verified User
Joined
Feb 14, 2007
Messages
109
Hi All

Cronjob notification
sed: can't read /usr/share/Modules/init/.modulespath: No such file or directory
though "Prevent Email" are not work when using jailshell


Cron command
/usr/local/php74/bin/php /home/XXXX/domains/domain.com/private_html/getdata.php >/dev/null 2>&1


User have received a large number of notify, Even though "Prevent Email" alert in Cronjob.

Email content :
can't read /usr/share/Modules/init/.modulespath: No such file or directory

1690396150391.png



PHP V7.4 (PHP-FPM) --- PHP cli no error
1690393703881.png



jailshell=2
1690393844849.png


# da info / AlmaLinux 8.8
version: 1.651
commit sha: c7b73cd05f44bddde4df9d27ea75aca4c82292a2
OS slug: linux_amd64
detected OS slug: rhel8_amd64
package: directadmin_c7b73cd05f44bddde4df9d27ea75aca4c82292a2_linux_amd64.tar.gz
gettext support: yes
gettext path: /usr/local/directadmin/data/lang
eol timestamp: 1880236800
eol time: Aug 1 00:00 2029

Found This the same problem.
 
Last edited:
i try enabled jailshell and 'Prevent Email' in Cronjob there are still email notifications being sent, it normal ?

User cron
*/1 * * * * curl https://xxx.com/test/test.sh | sh >/dev/null 2>&1


/var/log/exim/mainlog
2023-07-27 09:19:01 1qOqaj-00CfS4-22 <= h516522@ns110.xxx.com U=h516522 P=local S=1422 T="Cron <h516522@ns110> curl https://xxx.com/test/test.sh | sh >/dev/null 2>&1" from <h516522@ns110.xxx.com> for h516522
2023-07-27 09:19:01 cwd=/var/spool/exim 4 args: /usr/sbin/exim -odi -Mc 1qOqaj-00CfS4-22
2023-07-27 09:19:01 1qOqaj-00CfS4-22 => h516522 <h516522@ns110.xxx.com> F=<h516522@ns110.xxx.com> R=localuser T=local_delivery S=1557
2023-07-27 09:19:01 1qOqaj-00CfS4-22 Completed
 
Last edited:
I found the same problem, right now, just using script to delete those mail instead. but I want to find root cause of what was happen.
 
This has become a more complicated issue for us as we are using a lot more cron jobs. In my digging I believe that the scl-utils rpm is required for Immunify360, it isn't on other DA servers that I have. If you try and remove it the RPM dependency points to alt-php-internal.

It has a bug ID in redhat with a fix hopefully in the next major update, but I'm not holding my breath.

In the interim I've added a wrapper to the specific issue in /etc/profile.d/scl-init.sh

Hopefully this is helpful and doesn't break anything but since the whole issue is that the directory doesn't exist, ignoring it shouldn't be a problem.

Code:
if [ -d "${MODULESHOME}/init/.modulespath" ]; then
  if [ "${MODULEPATH:-}" = "" ]; then
    MODULEPATH=$(sed -n 's/[  #].*$//; /./H; $ { x; s/^\n//; s/\n/:/g; p; }' "${MODULESHOME}/init/.modulespath")
  fi
  MODULEPATH=/etc/scl/modulefiles:$MODULEPATH
else
  MODULEPATH=/etc/scl/modulefiles
fi
 
Back
Top