After an upgrade from version 15 to 16, some cron errors are generated at midnight:
Cron [email protected] [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null
sh: ifconfig: command not found
NB: no error during the upgrade process
Any help is welcome.
V15 installed with the Freepbx distro.
If it is Distro then it came with
Here is the kernel version info:
Linux 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
So yours “with-centos-7.8-Source” is different – not Distro.
100% installed from distro 2 years ago and indeed ifconfig is installed.
But error during the run under cron…
[[email protected] /]# which ifconfig
[[email protected] /]# uname -a
Linux pbx.xxx 3.10.0-1127.19.1.el7.x86_64 #1 SMP Tue Aug 25 17:23:54 UTC 2020 x86_64 x86_64 x86_64 GNU/Linux
su asterisk -c 'echo $PATH'
[[email protected] /]# ll /usr/sbin/ifconfig
-rwxr-xr-x 1 root root 81976 Aug 9 2019 /usr/sbin/ifconfig
[[email protected] /]# su asterisk -c ‘echo $PATH’
I have a Distro 16 system that was upgraded last weekend that is doing this. I have not done any troubleshooting yet as everything else seems working
fwconsole job --run at the command line should reveal the offender.
Doing a grep of the FreePBX code shows a number of places where ifconfig is used.
[[email protected] /]$ fwconsole job --run
Running calendar::sync…Starting Calendar Sync…
Running timeconditions::schedtc…==Working with TimeCondition:Business hours==
INVERTED BLF: false (NOT_INUSE = NOT_INUSE & INUSE = INUSE)
OVERRIDE MODE: not set
TIME MATCHED: True (NOT_INUSE)
BLF MODE: True (NOT_INUSE)
Changing TC1 to NOT_INUSE
Running userman::syncall…Directory ‘PBX Internal Directory’ does not support syncing
Directory ‘HPMS’ does not support syncing
Freepbx 16 running now for 10 days.
Still the daily error message but everything else seems working perfectly
“ifconfig” error is coming due to using 3rd party library. Ref - [FREEPBX-22970] FreePBX 16 > sh: ifconfig: command not found - Sangoma Issue Tracker
A github pr i.e. add option to be able to specify the ipconfig path. by vsc55 · Pull Request #3 · BlakeGardner/php-mac-address · GitHub is up to fix this issue in that 3rd party lib so waiting for that to get merge so we can pull the latest code.
same issue after upgrade to v16 . this should fix
ln -s /usr/sbin/ifconfig
the cronjob occurs around midnight. this shows it s/b fixed. time will tell:
su asterisk -c ifconfig
Edit: cronjob still has the issue.
Subject: Cron <[email protected]> [ -e /usr/sbin/fwconsole ] && sleep $((RANDOM%30)) && /usr/sbin/fwconsole job --run --quiet 2>&1 > /dev/null
sh: ifconfig: command not found
so need to fix PATH in the crontab used for the job
A new version of sysadmin module i.e. v220.127.116.11 has been pushed to EDGE with this issue fix.
Refer to - [FREEPBX-22970] FreePBX 16 > sh: ifconfig: command not found - Sangoma Issue Tracker
Good that a new version is on the way.
in the mean adding PATH line solves the issue:
# crontab -l -u asterisk
This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.