DirectAdmin doesn't send an email when new updates are found

Zagorax

Verified User
Joined
Jan 11, 2011
Messages
67
[SOLVED]DirectAdmin doesn't send an email when new updates are found

Hi,

Here is my options.conf (at least the part related to cron):
Code:
#Cron settings
cron=yes
cron_frequency=daily
email=<myemail>
notifications=yes
da_autoupdate=no
updates=no
webapps_updates=no

I did
Code:
./build cron

It's checking for new updates and I'm able to do
Code:
./build update_versions
, but I don't get any email from DirectAdmin. Could you help me to find what's wrong?
 
Last edited:
Does the cron actually run? Did you check /var/log/cron or /var/log/cron.log
 
Here is the output of 'grep custombuild /var/log/cron':

Code:
Apr 29 03:18:01 fs1 run-parts(/etc/cron.daily)[20245]: starting custombuild
Apr 29 03:18:13 fs1 run-parts(/etc/cron.daily)[23277]: finished custombuild
Apr 30 03:42:01 fs1 run-parts(/etc/cron.daily)[25069]: starting custombuild
Apr 30 03:42:13 fs1 run-parts(/etc/cron.daily)[28111]: finished custombuild
May  1 03:27:01 fs1 run-parts(/etc/cron.daily)[4917]: starting custombuild
May  1 03:27:14 fs1 run-parts(/etc/cron.daily)[7955]: finished custombuild
May  2 03:18:01 fs1 run-parts(/etc/cron.daily)[9354]: starting custombuild
May  2 03:18:13 fs1 run-parts(/etc/cron.daily)[12410]: finished custombuild
May  3 04:07:01 fs1 run-parts(/etc/cron.daily)[19397]: starting custombuild
May  3 04:07:13 fs1 run-parts(/etc/cron.daily)[22431]: finished custombuild

And here is the content of /etc/cron.daily/custombuild:

Code:
#!/bin/sh
cd /usr/local/directadmin/custombuild
./build update >/dev/null 2>&1
AVAIL_UPDATES="`./build versions_nobold | grep -c -e 'update is available.'`"
if [ "${AVAIL_UPDATES}" -gt 0 ]; then
./build versions_nobold | grep 'update is available.' | mail -s "${AVAIL_UPDATES} updates available for `hostname`" <myemail>
fi
exit 0;
 
Last edited:
Ok... I found the problem...

I tried to run custombuild on my own and I got:

Code:
./custombuild: line 6: mail: command not found

Will I break something installing sendmail?
 
Just install mailx

Code:
yum -y install mailx

Do not install sendmail
 
I dont think mailx is going to fix anything and here is why;

Notifications worked when i used Custombuild 1.2 then i changed to Customerbuild 2.0.
Notifications no longer work even though the options.conf is exactly the same.
 
I dont think mailx is going to fix anything and here is why;

Notifications worked when i used Custombuild 1.2 then i changed to Customerbuild 2.0.
Notifications no longer work even though the options.conf is exactly the same.

Actually, installing mailx solved the problem. But I'm still using custombuild 1.2.
 
Actually, installing mailx solved the problem. But I'm still using custombuild 1.2.

Thats why. Now if you go to 2.0 you will no longer get notifications.

[root@la1010 cron.daily]# cat custombuild
#!/bin/sh
cd /usr/local/directadmin/custombuild
./build update >/dev/null 2>&1
AVAIL_UPDATES="`./build versions_nobold | grep -c -e 'update is available.'`"
if [ "${AVAIL_UPDATES}" -gt 0 ]; then
./build versions_nobold | grep 'update is available.' | mail -s "${AVAIL_UPDATES} updates available for `hostname`" [email protected]
./build update_webapps
fi
exit 0;
 
Notifications no longer work even though the options.conf is exactly the same.
just make sure that you're not using a 1.2 options.conf.
The CB2 options.conf is quite different.. but the "cron" section will be the same.

If you're not getting updates, run the script manually:
Code:
cd /etc/cron.daily
./custombuild
to see what you get.

Also, add:
Code:
root: admin
to your /etc/aliases file, so that you get any emails about this cronjob sent to your "admin" account, if any output is generated. (exim doesn't accept root emails)

John
 
I'm not getting them either.

I was, then they suddenly stopped.

My box is running Debian.

This is the error I get if I run it manually:

Code:
/usr/lib/sendmail: No such file or directory
"/root/dead.letter" 14/537
. . . message not sent.

Any ideas?

Cheers.
 
Back
Top