HindrikOxilion
Verified User
- Joined
- Sep 23, 2011
- Messages
- 33
Hey everyone,
We're setting up some new CentOS 8 servers with DirectAdmin. When enabling the automatic update feature for DA only, a daily cronjob is created by the CustomBuild script thusly:
This results in the following relevant section in the CRONFILE /etc/cron.daily/custombuild:
Since we have chosen to start with only enabling auto-updates for DirectAdmin itself, and not the rest of the CB software (I won't go into reasons why , this creates an issue. When running the 'update_da' CB command, there is always output, which is then mailed by the crond:
Updating DirectAdmin
This in itself is not really a huge issue, but since the check triggers an update for all other versions too, it will continue to perform a DA update every day while there are also newer versions available for any other CB software. This causes a cron-mail every day with the text "Updating DirectAdmin", as long as there is other software to be upgraded.
I personally think the logic is flawed, the cron should only check for updates for DirectAdmin itself, and not all updates, when the option is specifically chosen to not update all other software and only DA itself.
So, my suggestion would be that CustomBuild script be changed. The check/trigger to perform the 'update_versions' command should include the line:
But the check/trigger to only 'update_da' should only match if there's an update for just/only DirectAdmin, something like:
Followed by:
Something to that effect.
I know that we simply could enable all automatic updates, or none, but this is a choice that is explicitly split by CustomBuild itself, so it should work accordingly in my opinion...
TL;DR: Only check for DirectAdmin update if only DirectAdmin auto-update is enabled
We're setting up some new CentOS 8 servers with DirectAdmin. When enabling the automatic update feature for DA only, a daily cronjob is created by the CustomBuild script thusly:
if [ "${UPDATES_OPT}" = "no" ] && [ "${DA_AUTOUPDATE_OPT}" = "yes" ]; then
echo './build update_da' >> ${CRONFILE}
fi
This results in the following relevant section in the CRONFILE /etc/cron.daily/custombuild:
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 update_da
fi
Since we have chosen to start with only enabling auto-updates for DirectAdmin itself, and not the rest of the CB software (I won't go into reasons why , this creates an issue. When running the 'update_da' CB command, there is always output, which is then mailed by the crond:
Updating DirectAdmin
This in itself is not really a huge issue, but since the check triggers an update for all other versions too, it will continue to perform a DA update every day while there are also newer versions available for any other CB software. This causes a cron-mail every day with the text "Updating DirectAdmin", as long as there is other software to be upgraded.
I personally think the logic is flawed, the cron should only check for updates for DirectAdmin itself, and not all updates, when the option is specifically chosen to not update all other software and only DA itself.
So, my suggestion would be that CustomBuild script be changed. The check/trigger to perform the 'update_versions' command should include the line:
echo "AVAIL_UPDATES=\"\`./build versions_nobold | grep -c -e 'update is available.'\`\"" >> ${CRONFILE}
But the check/trigger to only 'update_da' should only match if there's an update for just/only DirectAdmin, something like:
echo "DA_UPDATE=\"\`./build versions_nobold | grep -q -e 'DirectAdmin update is available.'\`\"" >> ${CRONFILE}
Followed by:
if [ "${DA_UPDATE}" ]; then
./build update_da
fi
Something to that effect.
I know that we simply could enable all automatic updates, or none, but this is a choice that is explicitly split by CustomBuild itself, so it should work accordingly in my opinion...
TL;DR: Only check for DirectAdmin update if only DirectAdmin auto-update is enabled