AndreL
(AndreL)
December 12, 2021, 8:31am
1
Hi,
After an upgrade from version 15 to 16, some cron errors are generated at midnight:
Cron asterisk@pbx [ -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.
André
AndreL
(AndreL)
December 12, 2021, 2:25pm
3
Linux-3.10.0-1127.19.1.el7.x86_64-x86_64-with-centos-7.8-Source
V15 installed with the Freepbx distro.
billsimon
(Bill Simon)
December 12, 2021, 5:47pm
4
If it is Distro then it came with ifconfig.
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.
AndreL
(AndreL)
December 12, 2021, 6:30pm
5
100% installed from distro 2 years ago and indeed ifconfig is installed.
But error during the run under cron…
AndreL
(AndreL)
December 12, 2021, 9:15pm
7
[root@pbx /]# which ifconfig
/usr/sbin/ifconfig
[root@pbx /]# 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
dicko
(dicko)
December 12, 2021, 9:21pm
8
su asterisk -c 'echo $PATH'
AndreL
(AndreL)
December 12, 2021, 9:24pm
9
[root@pbx /]# ll /usr/sbin/ifconfig
-rwxr-xr-x 1 root root 81976 Aug 9 2019 /usr/sbin/ifconfig
[root@pbx /]# su asterisk -c ‘echo $PATH’
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin
sorvani
(Jared Busch)
December 13, 2021, 1:52pm
10
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
billsimon
(Bill Simon)
December 13, 2021, 2:10pm
11
Running 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.
AndreL
(AndreL)
December 14, 2021, 8:47am
12
[asterisk@pbx /]$ fwconsole job --run
Running pagingpro::scheduler…Done
Running calendar::sync…Starting Calendar Sync…
Finished
Done
Running qxact_reports::sync…Done
Running dashboard::scheduler…Done
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)
Privilege: Command
Changing TC1 to NOT_INUSE
Done
Running userman::syncall…Directory ‘PBX Internal Directory’ does not support syncing
Directory ‘HPMS’ does not support syncing
Done
Running pms::wu_alert…Done
AndreL
(AndreL)
December 21, 2021, 10:07am
13
Freepbx 16 running now for 10 days.
Still the daily error message but everything else seems working perfectly
kgupta
(Kapil Gupta)
December 21, 2021, 10:17am
14
“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.
thanks.
robfantini
(robfantini)
January 3, 2022, 12:00pm
15
same issue after upgrade to v16 . this should fix
cd /usr/local/bin
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 <asterisk@freepbx-16> [ -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
kgupta
(Kapil Gupta)
January 4, 2022, 12:24pm
16
A new version of sysadmin module i.e. v16.0.6.4 has been pushed to EDGE with this issue fix.
Refer to - [FREEPBX-22970] FreePBX 16 > sh: ifconfig: command not found - Sangoma Issue Tracker
robfantini
(robfantini)
January 5, 2022, 11:56am
17
Good that a new version is on the way.
in the mean adding PATH line solves the issue:
# crontab -l -u asterisk
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin