Issue with asterisk crontab after last large round of updates

After the latest round of updates to the GUI, it seems something is wonky with the asterisk crontab entry. It’s now sending me an email every minute with the following (identifying info removed):

From: "(Cron Daemon)" <[email protected]>
To: [email protected]
Subject: Cron <[email protected]> [ -e /usr/sbin/fwconsole ] && sleep $(( ( RANDOM 

/bin/sh: -c: line 0: unexpected EOF while looking for matching `)'
/bin/sh: -c: line 1: syntax error: unexpected end of file

I have looked at the crontab for asterisk and it appears to be this line:

* * * * * [ -e /usr/sbin/fwconsole ] && sleep $(( ( RANDOM % 30 )  + 1 )) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null

It looks good from what I can see, you can run it manually and it’s happy, but I removed the RANDOM delay call and then all seemed fine.

Seems simple enough, but apparently making any change in the GUI results in it re-writing the cron entry and it puts it all back.

This is a current PBXact server, and I would say roll back the update, but this last batch was a huge round up updates, so not sure what th is would even be related too.

If any one has any ideas it would be a great help, and if not I guess it’s time to burn some support credits as getting thousands of failure messages a day is not a lot of fun…

cron by default runs as /bin/sh, you should prefix that command with /bin/bash or change the cron shell

Asked and answered: Cron job failing. Getting email every 1 minute

Thanks for the reply dicko. The problem is, it seems the GUI changes this anytime someone makes a change and commits it to the system. As this is a very large PBX, this happens usually a number of times every day, so it would just re-write the cron entery and take out any changes that I have made.

I thought this would be a simple fix it in the cron entry, but as the GUI changes it, I am guessing this has to be fixed down in the actual scripting someplace.

Do you, or does anyone know what module handles the changes to this cron file?

Super Lorne,

I searched and did not find that, so thanks for the pointer, I will update that module to edge…

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.