packages icon indicating copy to clipboard operation
packages copied to clipboard

Chilli dose not update time/date after NTP sync.

Open momothefox opened this issue 2 years ago • 6 comments

I am using chilli on openwrt and i use external radius system for authentication and accounting.

The thing is i noticed that users from some of my APs showing that start session is wrong dated. so i looked up accounting packets. and i could see clearly that chilli is reporting accounting packets with wrong date/time. while the AP date/time is correct.

i posted this to openwrt issues and i got this replay https://github.com/openwrt/openwrt/issues/10147#issuecomment-1182849625

below sample accounting packet dated Sat Jun 25 10:26:02 2022 while chilli reporting Event-Timestamp = "May 17 2022 23:02:13 EEST"

what do you think ?

Sat Jun 25 10:26:02 2022
	ChilliSpot-Version = "1.6"
	Attr-26.14559.10 = 0x00000001
	Event-Timestamp = "May 17 2022 23:02:13 EEST"
	User-Name = "63578476"
	Acct-Status-Type = Start
	Acct-Session-Id = "165614193900000004"
	Class = 0x61693a3761363432373831363038363930333836633838656131616539663638386261
	Framed-IP-Address = 192.168.182.3
	NAS-Port-Type = Wireless-802.11
	NAS-Port = 4
	NAS-Port-Id = "00000004"
	Calling-Station-Id = "XX-XX-XX-XX-XX-XX"
	Called-Station-Id = "XX-XX-XX-XX-XX-XX"
	NAS-IP-Address = 192.168.182.1
	NAS-Identifier = "XX-XX-XX-XX-XX-XX"
	WISPr-Location-ID = "<XXXXX>"
	WISPr-Location-Name = "<XXXXXX>"
	FreeRADIUS-Acct-Session-Start-Time = "Jun 25 2022 10:26:02 EEST"
	Tmp-String-9 = "ai:"
	Acct-Unique-Session-Id = "789071c12892308bfc34c2e4e4f265a3"
	Timestamp = 1656141962

momothefox avatar Jul 13 '22 12:07 momothefox

Startup sequence in openwrt chilli start priority is 90 while sysntpd start priority is 98

i have tested it with "manual" solution By disabling chilli autostart at boot time. and start it from NTP Hotplug - and it works but needs to be automated.

i think this should be changed in the default packaging because i think it limits the ease of mass firmware flashing.

Thanks for your efforts.

momothefox avatar Jul 30 '22 00:07 momothefox

Startup sequence in openwrt chilli start priority is 90 while sysntpd start priority is 98

i have tested it with "manual" solution By disabling chilli autostart at boot time. and start it from NTP Hotplug - and it works but needs to be automated.

i think this should be changed in the default packaging because i think it limits the ease of mass firmware flashing.

Thanks for your efforts.

Normally ntp hotplug event is used to reload affected services. Something like "if chilli is running, restart service". I wouldn't start chilli on ntp as some HW might have an RTC as well as some might not have ntp configured.

luizluca avatar Jul 30 '22 00:07 luizluca

Normally ntp hotplug event is used to reload affected services. Something like "if chilli is running, restart service". I wouldn't start chilli on ntp as some HW might have an RTC as well as some might not have ntp configured.

that's another reason why it should be changed in the default packaging

momothefox avatar Jul 30 '22 01:07 momothefox

Also it could be fixed from the Package it self. to make chilli update date/time after X seconds. So after NTP sync happen, chilli can report correct date/time

momothefox avatar Jul 30 '22 16:07 momothefox

If you wrote that script, why don't you submit the fix yourself? Also, it is normally nice to mention the package maintainer (@teslamint ) or even latest commiters on bug reports. It helps calling their attention.

luizluca avatar Jul 31 '22 02:07 luizluca

If you wrote that script, why don't you submit the fix yourself? Also, it is normally nice to mention the package maintainer (@teslamint ) or even latest commiters on bug reports. It helps calling their attention.

Thank you for mention of the package maintainer. i did not write any scripts.
it needs only one line to start chilli using NTP hotplug. creating file named 90-chilli in /etc/hotplug/ntp/ And the file is this line. /etc/init.d/chilli start

and you will have to disable auto start from openwrt startup. And thats it.

I suggested to change startup priority of chilli and ntp packages. and i got that solution. And i was told to post here if i think it should be changed in default packaging.

Thanks again and i will try to post in chilli on github.

momothefox avatar Jul 31 '22 03:07 momothefox

Solution for this is to disable chilli autostart @ boot and create file /etc/hotplug.d/ntp/90-chilli

#!/bin/sh
	/etc/init.d/chilli start

This makes Chilli starts after NTP Sync.

momothefox avatar Dec 15 '22 01:12 momothefox